Partager via


TextView.SetTextColor Method

Definition

Overloads

SetTextColor(ColorStateList)

Sets the text color.

SetTextColor(Color)

Sets the text color for all the states (normal, selected, focused) to be this color.

SetTextColor(ColorStateList)

Sets the text color.

[Android.Runtime.Register("setTextColor", "(Landroid/content/res/ColorStateList;)V", "GetSetTextColor_Landroid_content_res_ColorStateList_Handler")]
public virtual void SetTextColor (Android.Content.Res.ColorStateList? colors);
[<Android.Runtime.Register("setTextColor", "(Landroid/content/res/ColorStateList;)V", "GetSetTextColor_Landroid_content_res_ColorStateList_Handler")>]
abstract member SetTextColor : Android.Content.Res.ColorStateList -> unit
override this.SetTextColor : Android.Content.Res.ColorStateList -> unit

Parameters

Attributes

Remarks

Sets the text color.

Java documentation for android.widget.TextView.setTextColor(android.content.res.ColorStateList).

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.

See also

Applies to

SetTextColor(Color)

Sets the text color for all the states (normal, selected, focused) to be this color.

[Android.Runtime.Register("setTextColor", "(I)V", "GetSetTextColor_IHandler")]
public virtual void SetTextColor (Android.Graphics.Color color);
[<Android.Runtime.Register("setTextColor", "(I)V", "GetSetTextColor_IHandler")>]
abstract member SetTextColor : Android.Graphics.Color -> unit
override this.SetTextColor : Android.Graphics.Color -> unit

Parameters

color
Color

A color value in the form 0xAARRGGBB. Do not pass a resource ID. To get a color value from a resource ID, call androidx.core.content.ContextCompat#getColor(Context, int) getColor.

Attributes

Remarks

Sets the text color for all the states (normal, selected, focused) to be this color.

Java documentation for android.widget.TextView.setTextColor(int).

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.

See also

Applies to