我在布局相对布局时遇到了问题。下面是测试代码 RelativeLayout layout_centerInParent和layout_below问题
<RelativeLayout
android:background="@drawable/bg_controls"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/controls_layout"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/controls_layout" />
</RelativeLayout>
的,其结果是
如果我删除的android:layout_centerInParent = “真” 一切正常确定。为什么RelativeLayout无法做到这一点呢?
UPD:预期结果是第二个按钮出现在LinearLayout下。
预期结果是什么? – prolink007 2011-05-16 19:54:14
你究竟在做什么? – FoamyGuy 2011-05-16 19:54:58
预期的结果是第二个按钮出现在LinearLayout下。我认为这是显而易见的... – 2011-05-16 19:56:59