InputConnectionWrapper.SetComposingText 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| SetComposingText(ICharSequence, Int32) |
將目前正在合成的文字替換成給定的文字,並設定新的游標位置。 |
| SetComposingText(String, Int32) |
將目前正在合成的文字替換成給定的文字,並設定新的游標位置。 |
| SetComposingText(ICharSequence, Int32, TextAttribute) |
setComposingText(CharSequence,int) 的變體。 |
| SetComposingText(String, Int32, TextAttribute) |
setComposingText(CharSequence,int) 的變體。 |
SetComposingText(ICharSequence, Int32)
將目前正在合成的文字替換成給定的文字,並設定新的游標位置。
[Android.Runtime.Register("setComposingText", "(Ljava/lang/CharSequence;I)Z", "GetSetComposingText_Ljava_lang_CharSequence_IHandler")]
public virtual bool SetComposingText(Java.Lang.ICharSequence? text, int newCursorPosition);
[<Android.Runtime.Register("setComposingText", "(Ljava/lang/CharSequence;I)Z", "GetSetComposingText_Ljava_lang_CharSequence_IHandler")>]
abstract member SetComposingText : Java.Lang.ICharSequence * int -> bool
override this.SetComposingText : Java.Lang.ICharSequence * int -> bool
參數
- text
- ICharSequence
必要時,還有寫作風格。 若文字中沒有樣式物件,則使用預設的樣式來組合文字。 請參考 ISpanned 如何將樣式物件附加到文字上。 SpannableString以及 SpannableStringBuilder 是介面的兩種實作。ISpanned
- newCursorPosition
- Int32
文字周圍的新游標位置。 若 > 0,則相對於文本結尾為 - 1;若 <= 0,則相對於文本開頭。 所以值為 1 時,你總是會跳到插入全文之後的位置。 請注意,這表示你無法將游標置於文字中,因為編輯器可能會修改你提供的文字,導致無法正確指定該位置。
傳回
目標連線回傳的值。
實作
- 屬性
備註
將目前正在合成的文字替換成給定的文字,並設定新的游標位置。 任何先前設定的寫作文本都會自動移除。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetComposingText(String, Int32)
將目前正在合成的文字替換成給定的文字,並設定新的游標位置。
public bool SetComposingText(string? text, int newCursorPosition);
member this.SetComposingText : string * int -> bool
參數
- text
- String
寫作文本。 使用預設的文字寫作風格。
- newCursorPosition
- Int32
文字周圍的新游標位置。 若 > 0,則相對於文本結尾為 - 1;若 <= 0,則相對於文本開頭。 所以值為 1 時,你總是會跳到插入全文之後的位置。 請注意,這表示你無法將游標置於文字中,因為編輯器可能會修改你提供的文字,導致無法正確指定該位置。
傳回
字元序列過載的結果。 其預設實作會回傳目標連線所回傳的值。
備註
將目前正在合成的文字替換成給定的文字,並設定新的游標位置。 任何先前設定的寫作文本都會自動移除。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetComposingText(ICharSequence, Int32, TextAttribute)
setComposingText(CharSequence,int) 的變體。
[Android.Runtime.Register("setComposingText", "(Ljava/lang/CharSequence;ILandroid/view/inputmethod/TextAttribute;)Z", "GetSetComposingText_Ljava_lang_CharSequence_ILandroid_view_inputmethod_TextAttribute_Handler", ApiSince=33)]
public virtual bool SetComposingText(Java.Lang.ICharSequence text, int newCursorPosition, Android.Views.InputMethods.TextAttribute? textAttribute);
[<Android.Runtime.Register("setComposingText", "(Ljava/lang/CharSequence;ILandroid/view/inputmethod/TextAttribute;)Z", "GetSetComposingText_Ljava_lang_CharSequence_ILandroid_view_inputmethod_TextAttribute_Handler", ApiSince=33)>]
abstract member SetComposingText : Java.Lang.ICharSequence * int * Android.Views.InputMethods.TextAttribute -> bool
override this.SetComposingText : Java.Lang.ICharSequence * int * Android.Views.InputMethods.TextAttribute -> bool
參數
- text
- ICharSequence
要傳送至目標連線的撰寫文字。
- newCursorPosition
- Int32
文字周圍的新游標位置。 若 > 0,則相對於文本結尾為 - 1;若 <= 0,則相對於文本開頭。 所以值為 1 時,你總是會跳到插入全文之後的位置。 請注意,這表示你無法將游標置於文字中,因為編輯器可能會修改你提供的文字,導致無法正確指定該位置。
- textAttribute
- TextAttribute
傳遞給目標連線的可選文字元資料。
傳回
目標連線回傳的值。
實作
- 屬性
備註
setComposingText(CharSequence,int) 的變體。 此方法用於讓 IME 在撰寫文本時提供額外資訊。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetComposingText(String, Int32, TextAttribute)
setComposingText(CharSequence,int) 的變體。
public bool SetComposingText(string text, int newCursorPosition, Android.Views.InputMethods.TextAttribute? textAttribute);
abstract member SetComposingText : string * int * Android.Views.InputMethods.TextAttribute -> bool
override this.SetComposingText : string * int * Android.Views.InputMethods.TextAttribute -> bool
參數
- text
- String
作曲弦。
- newCursorPosition
- Int32
文字周圍的新游標位置。 若 > 0,則相對於文本結尾為 - 1;若 <= 0,則相對於文本開頭。 所以值為 1 時,你總是會跳到插入全文之後的位置。 請注意,這表示你無法將游標置於文字中,因為編輯器可能會修改你提供的文字,導致無法正確指定該位置。
- textAttribute
- TextAttribute
可選的文字元資料傳遞給字元序列過載。
傳回
字元序列過載的結果。 其預設實作會回傳目標連線所回傳的值。
實作
備註
setComposingText(CharSequence,int) 的變體。 此方法用於讓 IME 在撰寫文本時提供額外資訊。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。