在xml中
android:ellipsize = "end" 省略号在结尾
android:ellipsize = "start" 省略号在开头
android:ellipsize = "middle" 省略号在中间
android:ellipsize = "marquee" 跑马灯
最好加一个约束android:singleline = "true"
可以方便的解决textview里面内容过长的问题
Android的系统自带的文字外观设置及实际显示效果图
android:textAppearancexml布局里面设置文字的外观:
如“android:textAppearance=“?android:attr/textAppearanceLargeInverse”
这里引用的是系统自带的一个外观,?表示系统是否有这种外观,否则使用默认的外观。
可设置的值如下:
textAppearanceButton/
textAppearanceInverse/
textAppearanceLarge/
textAppearanceLargeInverse/
textAppearanceMedium/ t
extAppearanceSmallInverse/
textAppearanceMediumInverse/
textAppearanceSmall/
Android TextView 文字显示技巧
本文介绍了在Android中如何利用TextView的属性android:ellipsize实现不同位置的省略号显示,包括开始、结束和中间位置,并展示了如何启用跑马灯效果。此外,还提供了关于android:textAppearance属性的详细说明,帮助开发者快速美化界面文字。

1万+

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



