xml布局里面设置文字的外观:
如“android:textAppearance=“?android:attr/textAppearanceLargeInverse”这里引用的是系统自带的一个外观,
?表示系统是否有这种外观,否则使用默认的外观。
可设置的值如下:
textAppearanceButton/ 
textAppearanceInverse/ 
textAppearanceLarge/ 
textAppearanceLargeInverse/
textAppearanceMedium/ 
textAppearanceSmallInverse/
textAppearanceMediumInverse/
textAppearanceSmall/
代码中加下划线
textView.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线
textView.getPaint().setAntiAlias(true);//抗锯齿
textView.getPaint().setAntiAlias(true);//抗锯齿
本文介绍了 Android 中如何通过 xml 布局文件设置 TextView 的文字外观,包括使用系统预定义的文字样式,如 large、medium 和 small 等,并演示了如何在代码中为 TextView 添加下划线和抗锯齿效果。
1092

被折叠的 条评论
为什么被折叠?



