IInputConnection.SetComposingRegion 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| SetComposingRegion(Int32, Int32) |
將某個區域標記為正在創作的文字。 |
| SetComposingRegion(Int32, Int32, TextAttribute) |
的 |
SetComposingRegion(Int32, Int32)
將某個區域標記為正在創作的文字。
[Android.Runtime.Register("setComposingRegion", "(II)Z", "GetSetComposingRegion_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool SetComposingRegion(int start, int end);
[<Android.Runtime.Register("setComposingRegion", "(II)Z", "GetSetComposingRegion_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetComposingRegion : int * int -> bool
參數
- start
- Int32
書寫區域在文本中開始的位置
- end
- Int32
書寫區域在文本中結束的位置
傳回
true 成功時, false 若輸入連線不再有效。
從 Android android.os.Build.VERSION_CODES#N 直到 android.os.Build.VERSION_CODES#TIRAMISU,當目標應用程式未實作此方法時,此 API 會回傳 false 。
- 屬性
備註
將某個區域標記為正在創作的文字。 如果有合成區域,字元保持原狀,並移除作曲區間,就像 #finishComposingText() 被呼叫一樣。 使用預設的文字寫作風格。
通過的索引會被裁剪到內容範圍。 若所得區域大小為零,則不會標記區域,效果與呼叫 #finishComposingText()相同。 開始和結束的順序並不重要。 實際上,從頭到尾的區域和從頭到尾的區域是相同的。 編輯作者們,請準備好接受一個比結尾更重要的開頭。
由於這不會改變文本內容,編輯者不應呼叫 InputMethodManager#updateSelection(View, int, int, int, int) ,IME 也不應接收 android.inputmethodservice.InputMethodService#onUpdateSelection(int, int, int, int, int, int)。
這對游標或選取位置沒有影響。 這可能導致游標位於排版區域內或外,包括選取區與排版區部分或完全重疊的情況。
Java 文件 android.view.inputmethod.InputConnection.setComposingRegion(int, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetComposingRegion(Int32, Int32, TextAttribute)
的 InputConnection#setComposingRegion(int, int)變體。
[Android.Runtime.Register("setComposingRegion", "(IILandroid/view/inputmethod/TextAttribute;)Z", "GetSetComposingRegion_IILandroid_view_inputmethod_TextAttribute_Handler:Android.Views.InputMethods.IInputConnection, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=33)]
public virtual bool SetComposingRegion(int start, int end, Android.Views.InputMethods.TextAttribute? textAttribute);
[<Android.Runtime.Register("setComposingRegion", "(IILandroid/view/inputmethod/TextAttribute;)Z", "GetSetComposingRegion_IILandroid_view_inputmethod_TextAttribute_Handler:Android.Views.InputMethods.IInputConnection, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=33)>]
abstract member SetComposingRegion : int * int * Android.Views.InputMethods.TextAttribute -> bool
override this.SetComposingRegion : int * int * Android.Views.InputMethods.TextAttribute -> bool
參數
- start
- Int32
書寫區域在文本中開始的位置
- end
- Int32
書寫區域在文本中結束的位置
- textAttribute
- TextAttribute
關於文本的額外資訊。
傳回
true 成功時, false 若輸入連線不再有效。
從 Android android.os.Build.VERSION_CODES#N 直到 android.os.Build.VERSION_CODES#TIRAMISU,當目標應用程式未實作此方法時,此 API 會回傳 false 。
- 屬性
備註
的 InputConnection#setComposingRegion(int, int)變體。 此方法用於讓 IME 在設定文字時提供額外資訊。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。