TextView.SetText 方法

定义

重载

SetText(Char[], Int32, Int32)

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

SetText(Int32, TextView+BufferType)

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

SetText(String, TextView+BufferType)

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

SetText(Int32)

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

SetText(ICharSequence, TextView+BufferType)

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

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 无法知道文本已更改,并且需要使文本失效并重新布局。

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

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

适用于

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

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

属性

注解

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

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

适用于

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

注解

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

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

适用于

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

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

属性

注解

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

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

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

适用于

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

参数

属性

注解

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

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

适用于