大佬教程收集整理的这篇文章主要介绍了调整Android多行TextView的大小,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
复杂的是,如果我在setText中明确设置换行符,那么有时它会插入一个换行符,我没想到换行符,即:
"My first line of text\nMy Second line of text" Might get turned into (it's right adjusted in this version): "My first line of text My second line of text"
我不知道如何保持TextView试图插入换行符,或者让它只是照顾格式化整个事情.如果我将一些文本设置为一个真正长的单词,它会在某个选定的位置插入一个换行符.而其他时候,我只是随机得到最后几行文字.
我应该明确地将字体大小设置得很小,以便正确布局,然后手动调整大小?有没有一个“最佳实践”,我应该用这个?如果我将字体大小设置为相当大的字体,那么它的作品是很好的,但是找出这样做的“正确”方式是很好的.而且我宁可不必手动添加4行单行TextView并自己格式化.
我使用的布局xml是:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentright="true" android:layout_marginTop="10dip" android:layout_marginRight="8dip" android:singleLine="false" android:ellipsize="marque" android:gravity="right|bottom" android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="30sp" />
以上是大佬教程为你收集整理的调整Android多行TextView的大小全部内容,希望文章能够帮你解决调整Android多行TextView的大小所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。