0
私はこのヘッダーとフッターが固定されたこのmain.xmlレイアウトを持っています。受信したパラメータに基づいてボディコンテンツを変更する必要があります。ビューを膨らませてください
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#FFFFFF"
android:id="@+id/main_view">
<com.HeaderView
android:id="@+id/HeaderView"
android:layout_alignParentTop="true"
android:layout_width="fill_parent" android:layout_height="wrap_content" />
<com.FooterView
android:id="@+id/FooterView"
android:layout_alignParentBottom="true" android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/BodyView"
android:layout_below="@id/HeaderView"
android:layout_above="@id/FooterView"/>
</RelativeLayout>
は、以下の条件に基づいて、私はmain.xmlでBodyViewをロードする必要があります。
If parameter == Apple
then load layout AppleView in the BodyView
if parameter == Bat
then load layout BatView in the BodyView
AppleViewとBatViewのxmlレイアウトが定義されています。誰かがビューのいずれかを読み込み、そこから値をセット/取得する方法を教えてください。
私は申し訳ありませんが、このコードをどのように使用すればよいか把握できません。 –
詳細を教えてください。(各ifの後で)各テストの後、これを行う(レイアウトを膨らませる)。 –