【发布时间】:2012-04-07 21:20:03
【问题描述】:
所以,我有这样的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFF00"
android:minHeight="100dp"
android:layout_gravity="bottom"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textColor="#000000"
android:background="#FF0000"
android:text="Hello World"
/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:text="button"/>
</RelativeLayout>
这就是它的样子:
但如果我将android:layout_alignParentBottom="true" 添加到按钮,它的外观如下:
- 谁能解释一下这种行为?
- 如何在不调整黄色布局大小和不添加数千个布局的情况下将我的按钮放在底部?
【问题讨论】:
标签: android alignment android-relativelayout