У меня есть макет 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>
Исходя из следующих условий, мне нужно загрузить BodyView в main.xml.
If parameter == Apple
then load layout AppleView in the BodyView
if parameter == Bat
then load layout BatView in the BodyView
У меня AppleViewи определен макет BatView xml.Может кто-нибудь подсказать мне, как я могу загрузить любое из представлений и установить / получить значения в него / из него.