InputConnectionWrapper.ReplaceText 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| ReplaceText(Int32, Int32, ICharSequence, Int32, TextAttribute) |
在編輯器中將特定範圍替換成建議文字。 |
| ReplaceText(Int32, Int32, String, Int32, TextAttribute) |
在編輯器中將特定範圍替換成建議文字。 |
ReplaceText(Int32, Int32, ICharSequence, Int32, TextAttribute)
在編輯器中將特定範圍替換成建議文字。
[Android.Runtime.Register("replaceText", "(IILjava/lang/CharSequence;ILandroid/view/inputmethod/TextAttribute;)Z", "GetReplaceText_IILjava_lang_CharSequence_ILandroid_view_inputmethod_TextAttribute_Handler", ApiSince=34)]
public virtual bool ReplaceText(int start, int end, Java.Lang.ICharSequence text, int newCursorPosition, Android.Views.InputMethods.TextAttribute? textAttribute);
[<Android.Runtime.Register("replaceText", "(IILjava/lang/CharSequence;ILandroid/view/inputmethod/TextAttribute;)Z", "GetReplaceText_IILjava_lang_CharSequence_ILandroid_view_inputmethod_TextAttribute_Handler", ApiSince=34)>]
abstract member ReplaceText : int * int * Java.Lang.ICharSequence * int * Android.Views.InputMethods.TextAttribute -> bool
override this.ReplaceText : int * int * Java.Lang.ICharSequence * int * Android.Views.InputMethods.TextAttribute -> bool
參數
- start
- Int32
值為 0 或以上
- end
- Int32
值為 0 或以上
- text
- ICharSequence
指定範圍的替換文字。
- newCursorPosition
- Int32
文字周圍的新游標位置。 若 > 0,則相對於文本結尾為 - 1;若 <= 0,則相對於文本開頭。 所以值為 1 時,你總是會跳到插入全文之後的位置。 請注意,這代表你無法將游標置於文字中。
- textAttribute
- TextAttribute
傳遞給目標連線的可選文字元資料。
傳回
目標連線回傳的值。
實作
- 屬性
備註
在編輯器中將特定範圍替換成建議文字。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
ReplaceText(Int32, Int32, String, Int32, TextAttribute)
在編輯器中將特定範圍替換成建議文字。
public bool ReplaceText(int start, int end, string text, int newCursorPosition, Android.Views.InputMethods.TextAttribute? textAttribute);
abstract member ReplaceText : int * int * string * int * Android.Views.InputMethods.TextAttribute -> bool
override this.ReplaceText : int * int * string * int * Android.Views.InputMethods.TextAttribute -> bool
參數
- start
- Int32
值為 0 或以上
- end
- Int32
值為 0 或以上
- text
- String
指定範圍的替換字串。
- newCursorPosition
- Int32
文字周圍的新游標位置。 若 > 0,則相對於文本結尾為 - 1;若 <= 0,則相對於文本開頭。 所以值為 1 時,你總是會跳到插入全文之後的位置。 請注意,這代表你無法將游標置於文字中。
- textAttribute
- TextAttribute
可選的文字元資料傳遞給字元序列過載。
傳回
字元序列過載的結果。 其預設實作會回傳目標連線所回傳的值。
實作
備註
在編輯器中將特定範圍替換成建議文字。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。