TextView.SetText 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| SetText(String, TextView+BufferType) |
設定要使用字串資源標識碼顯示的文字。 |
| SetText(Char[], Int32, Int32) |
設定 TextView 以顯示指定之 char 陣列的指定配量。 |
| SetText(Int32, TextView+BufferType) |
設定要使用字串資源標識碼顯示的文字。 |
| SetText(Int32) |
設定要使用字串資源標識碼顯示的文字。 |
| SetText(ICharSequence, TextView+BufferType) |
設定要使用字串資源標識碼顯示的文字。 |
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
要用的文字。
- type
- TextView.BufferType
型別值。
備註
Java 文件 android.widget.TextView.setText(int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetText(Char[], Int32, Int32)
設定 TextView 以顯示指定之 char 陣列的指定配量。
[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 index
- len
- Int32
色號計數長度 start
- 屬性
備註
設定 TextView 以顯示指定之 char 陣列的指定配量。 你必須承諾不會更改陣列內容,除非在另一個呼叫 setText() 之前,否則不會改變,因為 TextView 無法知道文字是否已更改,也無法確定需要失效並重新排版。
Java 文件 android.widget.TextView.setText(char[], int, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
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
要顯示的字串資源的資源識別碼
- type
- TextView.BufferType
TextView.BufferType:一個 TextView.BufferType,定義文字是靜態文字、可樣式/可跨度文字,還是可編輯文字
- 屬性
備註
Java 文件 android.widget.TextView.setText(int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
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)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
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
參數
- text
- ICharSequence
要用的文字。
- type
- TextView.BufferType
TextView.BufferType:一個 TextView.BufferType,定義文字是靜態文字、可樣式/可跨度文字,還是可編輯文字
- 屬性
備註
Java 文件 android.widget.TextView.setText(int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。