大佬教程收集整理的这篇文章主要介绍了android textview没有正确包装,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我想避免为textview设置确切的大小.
换句话说,为什么当宽度/高度设置为fill_parent时,rowCreatedAt textView不会包装文本,而其他textViews包装文本就好了?
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://scheR_108_11845@as.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margin="5dp" android:layout_marginBottom="5dp" > <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <ImageView android:id="@+id/rowUserImage" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/twitter_icon" android:layout_margin="5dp"/> <TextView android:id="@+id/rowCreatedAt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:textSize="10dp" android:textColor="#ff696969" android:ellipsize="none" android:singleLine="false" android:scrollHorizontally="false" android:layout_weight="1" android:maxLines="100" android:text="aaaaaaaaaaaaaaabbbbbbbbbbbbbb" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/rowUserName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:text="username" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/rowText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:text="status text" /> </LinearLayout> </LinearLayout>
<TextView android:id="@+id/rowCreatedAt" android:layout_width="200dp" android:layout_height="wrap_content" android:gravity="center" android:textSize="10dp" android:textColor="#ff696969" android:ellipsize="none" android:singleLine="false" android:scrollHorizontally="false" android:layout_weight="1" android:maxLines="100" android:text="aaaaaaaaaaaaaaabbbbbbbbbbbbbb" />
将android:layout_width =“fill_parent”更改为android:layout_width =“200dp”
以上是大佬教程为你收集整理的android textview没有正确包装全部内容,希望文章能够帮你解决android textview没有正确包装所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。