Android, как загрузить linearlayout из другого XML-файла? - PullRequest
1 голос
/ 20 июля 2011

Скажем, у меня есть файл .xml с меню, которое выглядит следующим образом.

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/linearLayout1" android:orientation="vertical">
            <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout2">
            <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView1" android:src="@drawable/menubtm0"></ImageView>
        </LinearLayout>
        <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout3">
            <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/menubtm1" android:id="@+id/btm_fav" android:clickable="true"></ImageView>
            <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/menubtm2" android:id="@+id/btm_search" android:clickable="true"></ImageView>
            <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/menubtm3" android:id="@+id/btm_browse" android:clickable="true"></ImageView>
            <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/menubtm4" android:id="@+id/btm_settings" android:clickable="true"></ImageView>
        </LinearLayout>
    </LinearLayout>

Как лучше всего загрузить его в другой файл XML?Например в какой-нибудь FormLayout или что-то?

Спасибо!

1 Ответ

3 голосов
/ 20 июля 2011

Возможно, вы ищете тег Включить .

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...