IInputConnection.DeleteSurroundingTextInCodePoints(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
的變體 #deleteSurroundingText(int, int)。
[Android.Runtime.Register("deleteSurroundingTextInCodePoints", "(II)Z", "GetDeleteSurroundingTextInCodePoints_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public bool DeleteSurroundingTextInCodePoints(int beforeLength, int afterLength);
[<Android.Runtime.Register("deleteSurroundingTextInCodePoints", "(II)Z", "GetDeleteSurroundingTextInCodePoints_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member DeleteSurroundingTextInCodePoints : int * int -> bool
參數
- beforeLength
- Int32
游標前要刪除的字元數,以碼點表示。 如果這個數值超過文字開頭與游標之間現有字元數,則此方法不會失敗,而是刪除該範圍內的所有字元。
- afterLength
- Int32
游標後要刪除的字元數,以碼點表示。 如果這個數值超過游標與文字結尾之間現有字元數,則此方法不會失敗,而是刪除該範圍內的所有字元。
傳回
true 成功時, false 若輸入連線不再有效。
在 Android android.os.Build.VERSION_CODES#TIRAMISU之前,當目標應用程式未實作此方法時,會回傳 false 此 API。
- 屬性
備註
的變體 #deleteSurroundingText(int, int)。 主要差異有:
<ul><li>長度以碼點形式提供,而非以 Java 字元或字形形式呈現。</><li>若在請求範圍內存在一對或多對無效替代者,此方法不適用。</li></ul>
<強編>作者:</strong> 除了在 #deleteSurroundingText(int, int)要求中要求外,當發現更多無效的替代對在要求範圍內時,請確保什麼都不做。
Java 文件 android.view.inputmethod.InputConnection.deleteSurroundingTextInCodePoints(int, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。