Språk

BaseInputConnection.ReplaceText Method

Definition

Overloads

Name Description
ReplaceText(Int32, Int32, ICharSequence, Int32, TextAttribute)

Replace the specific range in the editor with suggested text.

ReplaceText(Int32, Int32, String, Int32, TextAttribute)

Replace the specific range in the editor with suggested text.

ReplaceText(Int32, Int32, ICharSequence, Int32, TextAttribute)

Replace the specific range in the editor with suggested text.

[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

Parameters

start
Int32

Value is 0 or greater

end
Int32

Value is 0 or greater

newCursorPosition
Int32

the new cursor position around the text. If > 0, this is relative to the end of the text - 1; if <= 0, this is relative to the start of the text. So a value of 1 will always advance you to the position after the full text being inserted. Note that this means you can't position the cursor within the text.

textAttribute
TextAttribute

Returns

true if the replace command was sent to the associated editor (regardless of whether the replacement is success or not), false otherwise.

Implements

Attributes

Remarks

Replace the specific range in the editor with suggested text.

Android reference for android.view.inputmethod.BaseInputConnection.replaceText.

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

ReplaceText(Int32, Int32, String, Int32, TextAttribute)

Replace the specific range in the editor with suggested text.

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

Parameters

start
Int32

Value is 0 or greater

end
Int32

Value is 0 or greater

text
String
newCursorPosition
Int32

the new cursor position around the text. If > 0, this is relative to the end of the text - 1; if <= 0, this is relative to the start of the text. So a value of 1 will always advance you to the position after the full text being inserted. Note that this means you can't position the cursor within the text.

textAttribute
TextAttribute

Returns

true if the replace command was sent to the associated editor (regardless of whether the replacement is success or not), false otherwise.

Implements

Remarks

Replace the specific range in the editor with suggested text.

Android reference for android.view.inputmethod.BaseInputConnection.replaceText.

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