Skip to content

UITextPosition

UITextPosition 表示文本中的一个位置点。插件运行时中它与 UITextRangeUITextInputMode 一起出现,用于描述选区、标记文本等概念。

当前运行时为 UITextPosition 暴露了一组与“文本范围/输入上下文”相关的字段(语义与用途高度依赖具体实现)。常见用法是把它作为只读数据从运行时取回并传递给其他 API。

属性类型说明
primaryLanguagestring | null只读。主要语言。
markedTextRangeUITextRange | null只读。标记文本范围。
selectedTextRangeUITextRange | null当前选区(可读写)。
markedTextStyleNSDictionary | null标记文本样式。
beginningOfDocumentUITextPosition | null只读。文档起点。
endOfDocumentUITextPosition | null只读。文档终点。
startUITextPosition | null只读。范围起点。
endUITextPosition | null只读。范围终点。
textstring | null只读。文本内容(若运行时提供)。
rect{ x: number, y: number, width: number, height: number }只读。相关区域。
tokenizerid只读。分词器对象。
textInputViewUIView | null只读。输入视图。
emptyboolean只读。是否为空。
isVerticalboolean只读。是否垂直布局。
containsStartboolean只读。是否包含起点。
containsEndboolean只读。是否包含终点。
alternativeInterpretationsNSArray只读。备选解释列表。
inputDelegateid输入代理对象。

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

头文件 API 清单

正在加载…

协议:,来源: