语言

InputConnectionWrapper.SetSelection(Int32, Int32) 方法

定义

设置文本编辑器的选择。

[Android.Runtime.Register("setSelection", "(II)Z", "GetSetSelection_IIHandler")]
public virtual bool SetSelection(int start, int end);
[<Android.Runtime.Register("setSelection", "(II)Z", "GetSetSelection_IIHandler")>]
abstract member SetSelection : int * int -> bool
override this.SetSelection : int * int -> bool

参数

start
Int32

选择应从其开始的字符索引。

end
Int32

所选内容应结束的字符索引。

返回

目标连接返回的值。

实现

特性

注解

设置文本编辑器的选择。 若要设置光标位置,开始和结束应具有相同的值。

Java文档android.view.inputmethod.InputConnectionWrapper.setSelection(int, int)。

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于