美文网首页
07.论在TextView中添加的文字不清楚宽度的情况下布局:

07.论在TextView中添加的文字不清楚宽度的情况下布局:

作者: 随风_逝 | 来源:发表于2018-06-29 15:20 被阅读41次

很多情况下,我们要在TextView中添加的文字不清楚宽度的情况下
设置LinearLayout中android:layout_width="0dp"和 android:layout_weight="1"就会给你自动撑起宽度。

         <LinearLayout
                android:layout_width="0dp"
                android:layout_height="80dp"
                android:layout_marginRight="10dp"
                android:layout_weight="1"
                android:orientation="vertical"
                android:padding="10dp">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingBottom="5dp"
                    android:textSize="16dp"
                    android:text="添加大量文字"
                    android:textColor="@color/white" />
            </LinearLayout>

相关文章

网友评论

      本文标题:07.论在TextView中添加的文字不清楚宽度的情况下布局:

      本文链接:https://www.haomeiwen.com/subject/vkeayftx.html