Skip to content

UITextView

UITextView 继承自 UIScrollView,用于展示与编辑多行文本。插件运行时暴露了常用的文本属性与少量方法。

属性类型说明
textstring文本内容。
attributedTextNSAttributedString | null富文本内容。
textColorUIColor | null文本颜色。
fontUIFont | null字体。
textAlignmentnumber对齐方式。
editableboolean是否可编辑。
selectableboolean是否可选中。
allowsEditingTextAttributesboolean是否允许编辑文字属性。
dataDetectorTypesnumber数据检测类型。
typingAttributesNSDictionary | null输入时使用的属性。
selectedRangeobject当前选区范围。
textContainerInsetobject文本容器内边距。
layoutManagerid只读。布局管理器。
textStorageNSTextStorage只读。文本存储。
textContainerid只读。文本容器。
方法参数返回值说明
scrollRangeToVisible(range)range: objectvoid滚动使指定文本范围可见。
initWithFrameTextContainer(frame, textContainer)frame: { x: number, y: number, width: number, height: number }, textContainer: id | nullUITextView以 frame 与 textContainer 初始化。

当前运行时未额外暴露 UITextView 的类成员。

头文件 API 清单

正在加载…

协议:,来源: