0

レイアウト用に7つのxmlファイルがあり、それらすべてを1つのxmlファイルに結合できるかどうか疑問に思っていましたか? すべてのレイアウトは似ており、前後に移動する 2 つのボタンと中央に画像があります。

4

3 に答える 3

0

以下のように使用します。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" 
    android:layout_width=”match_parent”
    android:layout_height=”match_parent”
    android:background="@color/app_bg"
    android:gravity="center_horizontal">

    <include layout="@layout/titlebar"/>

    <TextView android:layout_width=”match_parent”
              android:layout_height="wrap_content"
              android:text="@string/hello"
              android:padding="10dp" />

    ...

</LinearLayout>

詳細については、この記事を確認してください

于 2013-06-12T07:18:41.550 に答える
0

インクルードとマージを使用できますが、7 つのレイアウトがほぼ同じである場合は、おそらく 1 つだけを使用できることに注意してください。

それらの小さな違いは何ですか?

于 2013-06-12T07:20:39.647 に答える