別の b.xml レイアウトに含まれる a.xml レイアウトにあるビューにアクセスする必要があります。たとえば、これは a.xml です。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/xyz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="XYZ" />
</RelativeLayout>
そして、b.xmlで
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<include
android:id="@+id/a_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
layout="@layout/a" />
<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/xyz"
android:text="Show me below xyz" />
</RelativeLayout>
Javaで行う場合はsetContentView()の後に行う必要があり、TextViewの「ラベル」のLayoutParamsを設定しても効果がないため、xmlコードで行う必要があります。
私が何を尋ねようとしているのか、誰もが理解していると思います。良い返事を待っています。
皆さんありがとう。
右側の画像は私が達成しようとしているもので、左側の画像は現在のコードで得ているものです。