Android 安卓系统-<;合并/>;标记与RelativeLayout根冲突
Android 安卓系统-<;合并/>;标记与RelativeLayout根冲突,android,android-layout,Android,Android Layout,我正在尝试将三个包含的布局放置在一个RelativeLayout中 在每个包含的布局中,我都使用工具:showIn选项,因为布局的根是 问题在于,包含的布局标签重叠,好像下面的布局被完全忽略: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_pa
我正在尝试将三个包含的布局放置在一个RelativeLayout中
在每个包含的布局中,我都使用
工具:showIn
选项,因为布局的根是
问题在于,包含的布局标签重叠,好像下面的布局被完全忽略:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/header"
layout="@layout/collab_header_layout"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<include
android:id="@+id/body"
layout="@layout/collab_body_layout"
android:layout_width="match_parent"
android:layout_height="225dp"
android:layout_below="@id/header" />
<include
android:id="@+id/footer"
layout="@layout/collab_footer_layout"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_below="@id/body" />
</RelativeLayout>
我已经尝试在根标记不是
的地方包含另一个布局,我可以将它定位在相对布局中而不会出现问题我该怎么办
Thx预期 所有位置都需要在合并布局内声明
i、 e:
<-- Root Layout -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include android:id="@+id/tab1"
layout="@layout/tab_1"
android:layout_height="100dp"
android:layout_width="wrap_content"/>
<include
android:id="@+id/header"
layout="@layout/collab_header_layout"
android:layout_width="wrap_content"
android:layout_height="90dp"/>
</RelativeLayout>
尝试在下面的布局_上使用+id/{id},或者最好使用垂直方向的线性布局
<-- Merged layout -->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showIn="@layout/collab_layout">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Header"
android:layout_below="@id/tab1"/>
</merge>