【发布时间】:2016-06-27 14:54:43
【问题描述】:
我在一个线性布局(水平)中有 3 个 TextView,当最后一个 textview 太大或没有空间时,它与父级匹配,如下图所示:
我想要的是,如果文本视图达到线性布局的宽度,那么,文本视图应该移动到“属性”文本视图下方。 (下一行)
看看它应该是怎样的:
这是我的 XML 的 sn-p:
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearance"
android:text="Property"
android:id="@+id/txtPropertyType" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearance"
android:text="/ 127 m"
android:id="@+id/txtArea"
android:layout_marginLeft="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearance"
android:text="/ 3 roomsssssssssdddd"
android:singleLine="false"
android:id="@+id/txtNumRoom"
android:layout_marginLeft="5dp" />
</LinearLayout>
在此先感谢 x)
【问题讨论】: