I have a layout for the header and the footer. And I also have a preference.xml layout. What I want to do right now is I want to include the normal layout into the preference.xml

Any idea on how to include the normal xml layout into the preference.xml layout ?

有帮助吗?

解决方案

with include you can add a layout to other layouts:

Example:

<include
    android:id="@+id/include1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    layout="@layout/normal_layout" />

其他提示

You can use tag to include layouts in xml file.

<include
android:id="@+id/header_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
layout="@layout/normal_layout" />
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top