Udostępnij za pośrednictwem


BaseInputConnection.DeleteSurroundingText(Int32, Int32) Method

Definition

The default implementation performs the deletion around the current selection position of the editable text.

[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

Parameters

beforeLength
Int32

The number of characters before the cursor to be deleted, in code unit. If this is greater than the number of existing characters between the beginning of the text and the cursor, then this method does not fail but deletes all the characters in that range.

afterLength
Int32

The number of characters after the cursor to be deleted, in code unit. If this is greater than the number of existing characters between the cursor and the end of the text, then this method does not fail but deletes all the characters in that range.

Returns

true when selected text is deleted, false when either the selection is invalid or not yet attached (i.e. selection start or end is -1), or the editable text is null.

Implements

Attributes

Remarks

The default implementation performs the deletion around the current selection position of the editable text.

Java documentation for android.view.inputmethod.BaseInputConnection.deleteSurroundingText(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to