Question

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 ?

Was it helpful?

Solution

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" />

OTHER TIPS

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" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top