语言

TextView.SetTextAppearance 方法

定义

重载

名称 说明
SetTextAppearance(Int32)

设置指定样式资源中的文本外观。

SetTextAppearance(Context, Int32)
已过时.

设置指定 TextAppearance 资源中的文本颜色、大小、样式、提示颜色和突出显示颜色。

SetTextAppearance(Int32)

设置指定样式资源中的文本外观。

[Android.Runtime.Register("setTextAppearance", "(I)V", "GetSetTextAppearance_IHandler", ApiSince=23)]
public virtual void SetTextAppearance(int resId);
[<Android.Runtime.Register("setTextAppearance", "(I)V", "GetSetTextAppearance_IHandler", ApiSince=23)>]
abstract member SetTextAppearance : int -> unit
override this.SetTextAppearance : int -> unit

参数

resId
Int32

要应用的样式的资源标识符

属性

注解

设置指定样式资源中的文本外观。

使用框架定义的 TextAppearance 样式,例如 android.R.style#TextAppearance_Material_Body1 @android:style/TextAppearance.Material.Body1 或查看 android.R.styleable#TextAppearance TextAppearance 可用于自定义样式的属性集。

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

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

适用于

SetTextAppearance(Context, Int32)

注意

deprecated

设置指定 TextAppearance 资源中的文本颜色、大小、样式、提示颜色和突出显示颜色。

[Android.Runtime.Register("setTextAppearance", "(Landroid/content/Context;I)V", "GetSetTextAppearance_Landroid_content_Context_IHandler")]
[System.Obsolete("deprecated")]
public virtual void SetTextAppearance(Android.Content.Context? context, int resId);
[<Android.Runtime.Register("setTextAppearance", "(Landroid/content/Context;I)V", "GetSetTextAppearance_Landroid_content_Context_IHandler")>]
[<System.Obsolete("deprecated")>]
abstract member SetTextAppearance : Android.Content.Context * int -> unit
override this.SetTextAppearance : Android.Content.Context * int -> unit

参数

context
Context

用于访问应用程序资源和服务的上下文。

resId
Int32

要应用的样式的资源标识符

属性

注解

设置指定 TextAppearance 资源中的文本颜色、大小、样式、提示颜色和突出显示颜色。

此成员已弃用。 改用 #setTextAppearance(int)。

Java文档android.widget.TextView.setTextAppearance(android.content.Context, int)。

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

适用于