【发布时间】:2017-12-14 13:52:50
【问题描述】:
我有一个 RelativeLayout,其中有一个 TextView 和一个按钮。按钮有一个属性android:layout_alignParentBottom="true",没关系。问题是 TextView:如果文本很大,它会在按钮后面。
<RelativeLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/absoluteLayout1">
<TextView
android:text="Long long string"
android:textSize="16dp"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#d9e700"
android:id="@+id/text"
android:layout_marginBottom="12.5dp" />
<Button
android:text="Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="@+id/button1" />
</RelativeLayout>
我需要的是不会出现在按钮后面的可调整大小的 TextView。如果文本很大,我们只能看到适合顶部和按钮之间大小的文本部分。 类似于两行,其中第 2 行(带按钮)具有固定高度,第 1 行可调整大小。 有人知道怎么做吗?
【问题讨论】:
标签: android xml android-layout xamarin