BaseInputConnection.DeleteSurroundingText(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
預設實作會在可編輯文本當前選取位置附近進行刪除。
[Android.Runtime.Register("deleteSurroundingText", "(II)Z", "GetDeleteSurroundingText_IIHandler")]
public virtual bool DeleteSurroundingText(int beforeLength, int afterLength);
[<Android.Runtime.Register("deleteSurroundingText", "(II)Z", "GetDeleteSurroundingText_IIHandler")>]
abstract member DeleteSurroundingText : int * int -> bool
override this.DeleteSurroundingText : int * int -> bool
參數
- beforeLength
- Int32
游標前要刪除的字元數,以代碼單位表示。 如果這個數值超過文字開頭與游標之間現有字元數,則此方法不會失敗,而是刪除該範圍內的所有字元。
- afterLength
- Int32
游標後要刪除的字元數,以程式碼單位表示。 如果這個數值超過游標與文字結尾之間現有字元數,則此方法不會失敗,而是刪除該範圍內的所有字元。
傳回
true 當選取的文字被刪除時, false 當選取的選取無效或尚未附加(即選取開始或結束 -1),或可編輯的文字為 null。
實作
- 屬性
備註
預設實作會在可編輯文本當前選取位置附近進行刪除。
的 android.view.inputmethod.BaseInputConnection.deleteSurroundingText(int, int)Java 檔。
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。