TextView.SetText 方法

定义

重载

名称 说明
SetText(Int32)

设置使用字符串资源标识符显示的文本。

SetText(ICharSequence, TextView+BufferType)

设置使用字符串资源标识符显示的文本。

SetText(Int32, TextView+BufferType)

设置使用字符串资源标识符显示的文本。

SetText(String, TextView+BufferType)

设置使用字符串资源标识符显示的文本。

SetText(Char[], Int32, Int32)

设置 TextView 以显示指定字符数组的指定切片。

SetText(Int32)

设置使用字符串资源标识符显示的文本。

[Android.Runtime.Register("setText", "(I)V", "")]
public void SetText(int resid);
[<Android.Runtime.Register("setText", "(I)V", "")>]
member this.SetText : int -> unit

参数

resid
Int32

要显示的字符串资源的资源标识符

属性

注解

设置使用字符串资源标识符显示的文本。

Java文档android.widget.TextView.setText(int)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetText(ICharSequence, TextView+BufferType)

设置使用字符串资源标识符显示的文本。

[Android.Runtime.Register("setText", "(Ljava/lang/CharSequence;Landroid/widget/TextView$BufferType;)V", "GetSetText_Ljava_lang_CharSequence_Landroid_widget_TextView_BufferType_Handler")]
public virtual void SetText(Java.Lang.ICharSequence? text, Android.Widget.TextView.BufferType? type);
[<Android.Runtime.Register("setText", "(Ljava/lang/CharSequence;Landroid/widget/TextView$BufferType;)V", "GetSetText_Ljava_lang_CharSequence_Landroid_widget_TextView_BufferType_Handler")>]
abstract member SetText : Java.Lang.ICharSequence * Android.Widget.TextView.BufferType -> unit
override this.SetText : Java.Lang.ICharSequence * Android.Widget.TextView.BufferType -> unit

参数

属性

注解

Java文档android.widget.TextView.setText(int)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetText(Int32, TextView+BufferType)

设置使用字符串资源标识符显示的文本。

[Android.Runtime.Register("setText", "(ILandroid/widget/TextView$BufferType;)V", "")]
public void SetText(int resid, Android.Widget.TextView.BufferType? type);
[<Android.Runtime.Register("setText", "(ILandroid/widget/TextView$BufferType;)V", "")>]
member this.SetText : int * Android.Widget.TextView.BufferType -> unit

参数

resid
Int32

要显示的字符串资源的资源标识符

属性

注解

Java文档android.widget.TextView.setText(int)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetText(String, TextView+BufferType)

设置使用字符串资源标识符显示的文本。

public void SetText(string? text, Android.Widget.TextView.BufferType? type);
member this.SetText : string * Android.Widget.TextView.BufferType -> unit

参数

text
String

注解

Java文档android.widget.TextView.setText(int)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetText(Char[], Int32, Int32)

设置 TextView 以显示指定字符数组的指定切片。

[Android.Runtime.Register("setText", "([CII)V", "")]
public void SetText(char[] text, int start, int len);
[<Android.Runtime.Register("setText", "([CII)V", "")>]
member this.SetText : char[] * int * int -> unit

参数

text
Char[]

要显示的 char 数组

start
Int32

char 数组中的 start 索引

len
Int32

字符计数之后的长度 start

属性

注解

设置 TextView 以显示指定字符数组的指定切片。 您必须承诺,除了另一次调用 setText()之前,您不会更改数组的内容,因为 TextView 无法知道文本已更改,并且需要使文本失效并重新布局。

Java文档android.widget.TextView.setText(char[], int, int)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于