Android &引用;安卓:上面的布局“;RelativeLayout中的参数
首先,这是我的xml:Android &引用;安卓:上面的布局“;RelativeLayout中的参数,android,layout,android-relativelayout,Android,Layout,Android Relativelayout,首先,这是我的xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" an
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="@android:color/white">
<LinearLayout [...]
android:layout_above"@+id/test">
</LinearLayout>
<LinearLayout [...]>
<LinearLayout [...]
android:id="@+id/test"/>
</LinearLayout>
</RelativeLayout>
此xml无法工作
有没有这样做的选择?将上面的
android:layout\u参数设置为另一个视图中的视图?我修改了一些代码。。请试试这个
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="@android:color/white">
<LinearLayout [...]
android:id="@+id/test">
</LinearLayout>
<LinearLayout [...]
android:layout_below"@+id/test">
<LinearLayout [...]/>
</LinearLayout>
</RelativeLayout>
实际上,他在相对论中使用了它。。。但我认为目标也必须是这个亲戚的直接孩子,所以没有机会这么做?当然,有另一种方法可以实现你的目标,但你需要给出更多的细节来解释。布局以自上而下的方式处理其子级,因此上面的任何布局、下面的布局等都必须在布局文件中实际引用其上方的视图。