Android textAppearance的属性设置及TextView属性详解

android:textAppearance

"引——没有拼命的干劲,怎能有精彩的结果!"

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);//抗锯齿
 
android:linksClickable设置链接是否点击连接,即使设置了autoLink。
android:marqueeRepeatLimit在ellipsize指定marquee的情况下,设置重复滚动的次数,当设置为 marquee_forever时表示无限次。
android:ems设置TextView的宽度为N个字符的宽度。这里测试为一个汉字字符宽度
android:maxEms设置TextView的宽度为最长为N个字符的宽度。与ems同时使用时覆盖ems选项。
android:minEms设置TextView的宽度为最短为N个字符的宽度。与ems同时使用时覆盖ems选项。
android:maxLength限制显示的文本长度,超出部分不显示。
android:lines设置文本的行数,设置两行就显示两行,即使第二行没有数据。
android:maxLines设置文本的最大显示行数,与width或者layout_width结合使用,超出部分自动换行,超出行数将不显示。
android:minLines设置文本的最小行数,与lines类似。
android:lineSpacingExtra设置行间距。
android:lineSpacingMultiplier设置行间距的倍数。如”1.2”
 
 
原文地址:https://www.cnblogs.com/Lt-Java13/p/4402436.html