EditorInfo.GetInitialTextBeforeCursorFormatted(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 <當前游標位置前的文字>長度</var> 字元。
[Android.Runtime.Register("getInitialTextBeforeCursor", "(II)Ljava/lang/CharSequence;", "GetGetInitialTextBeforeCursor_IIHandler", ApiSince=30)]
public virtual Java.Lang.ICharSequence? GetInitialTextBeforeCursorFormatted(int length, int flags);
[<Android.Runtime.Register("getInitialTextBeforeCursor", "(II)Ljava/lang/CharSequence;", "GetGetInitialTextBeforeCursor_IIHandler", ApiSince=30)>]
abstract member GetInitialTextBeforeCursorFormatted : int * int -> Java.Lang.ICharSequence
override this.GetInitialTextBeforeCursorFormatted : int * int -> Java.Lang.ICharSequence
參數
- length
- Int32
文字的預期長度。
- flags
- Int32
提供更多選項來控制文字回傳方式。 可能是 0 或 InputConnection#GET_TEXT_WITH_STYLES。
傳回
游標位置前的文字;回傳文字的長度可能小於 <var>長度</var>。 當游標前沒有文字時,會回傳一個空字串。 也可能是 null 當編輯器或系統無法支援此協定時。
- 屬性
備註
取得 <當前游標位置前的文字>長度</var> 字元。 可能是 null 因為該協定不支援。
Java 文件 android.view.inputmethod.EditorInfo.getInitialTextBeforeCursor(int, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。