EditorInfo.SetInitialSurroundingSubText 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| SetInitialSurroundingSubText(ICharSequence, Int32) |
編輯者可使用此方法為IME提供初始輸入文字。 |
| SetInitialSurroundingSubText(String, Int32) |
編輯者可使用此方法為IME提供初始輸入文字。 |
SetInitialSurroundingSubText(ICharSequence, Int32)
編輯者可使用此方法為IME提供初始輸入文字。
[Android.Runtime.Register("setInitialSurroundingSubText", "(Ljava/lang/CharSequence;I)V", "GetSetInitialSurroundingSubText_Ljava_lang_CharSequence_IHandler", ApiSince=30)]
public virtual void SetInitialSurroundingSubText(Java.Lang.ICharSequence subText, int subTextStart);
[<Android.Runtime.Register("setInitialSurroundingSubText", "(Ljava/lang/CharSequence;I)V", "GetSetInitialSurroundingSubText_Ljava_lang_CharSequence_IHandler", ApiSince=30)>]
abstract member SetInitialSurroundingSubText : Java.Lang.ICharSequence * int -> unit
override this.SetInitialSurroundingSubText : Java.Lang.ICharSequence * int -> unit
參數
- subText
- ICharSequence
輸入文字。 修剪時必須 subTextStart 正確提供。
- subTextStart
- Int32
輸入文字被裁剪的位置。 例如,當編輯器想要刪除前 10 個字元時,subTextStart 應該是 10。
- 屬性
備註
編輯者可使用此方法為IME提供初始輸入文字。 由於周圍文字可用於提供各種輸入協助,我們建議編輯者在回調時提供完整的初始輸入文字 View#onCreateInputConnection(EditorInfo) 。 當需要修剪輸入文字時,請呼叫這個方法, setInitialSurroundingText(CharSequence) 並提供修剪後的位置資訊。 務必盡量包含所選文字 subText ,讓系統有最佳彈性,在必要時選擇修剪的位置與方式 subText 。
從 開始 VERSION_CODES#S,未實作 Parcelable 的跨度將自動被捨棄。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetInitialSurroundingSubText(String, Int32)
編輯者可使用此方法為IME提供初始輸入文字。
public void SetInitialSurroundingSubText(string subText, int subTextStart);
member this.SetInitialSurroundingSubText : string * int -> unit
參數
- subText
- String
輸入文字。 修剪時必須 subTextStart 正確提供。
- subTextStart
- Int32
輸入文字被裁剪的位置。 例如,當編輯器想要刪除前 10 個字元時,subTextStart 應該是 10。
備註
編輯者可使用此方法為IME提供初始輸入文字。 由於周圍文字可用於提供各種輸入協助,我們建議編輯者在回調時提供完整的初始輸入文字 View#onCreateInputConnection(EditorInfo) 。 當需要修剪輸入文字時,請呼叫這個方法, setInitialSurroundingText(CharSequence) 並提供修剪後的位置資訊。 務必盡量包含所選文字 subText ,讓系統有最佳彈性,在必要時選擇修剪的位置與方式 subText 。
從 開始 VERSION_CODES#S,未實作 Parcelable 的跨度將自動被捨棄。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。