EditorInfo.SetInitialSurroundingSubText 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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
的範圍將會自動卸除。
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
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
的範圍將會自動卸除。
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。