
我已经使用maxline属性配置了TextVIEw,并且我将其值设置为3,因为我不想要超过3行文本,而且我还使用了ellipsize属性.
但它不能正常工作.虽然文本大于3行,但它只打印两行.
<TextVIEw androID:ID="@+ID/etLugar" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:layout_alignBaseline="@+ID/tvLugar" androID:layout_marginleft="15dp" androID:layout_toRightOf="@+ID/tvLugar" androID:text="A very large text than must be shown in the textvIEw,but no more of three lines are going to be shown" androID:textcolor="@color/foreground1" androID:maxlines="3" androID:ellipsize="end" androID:textSize="12dp" />
我不明白为什么maxlines属性不能正常工作.我做错了什么?
谢谢
解决方法 我猜这是由于androID:singleline =“false”这是默认值try并将其更改为TRUE 告诉它是否有效. 总结以上是内存溢出为你收集整理的android – TextView多线全部内容,希望文章能够帮你解决android – TextView多线所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)