語言

EditorInfo.GetInitialTextBeforeCursor(Int32, Int32) 方法

定義

取得 <當前游標位置前的文字>長度</var> 字元。

public string? GetInitialTextBeforeCursor(int length, int flags);
member this.GetInitialTextBeforeCursor : int * int -> string

參數

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 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於