左と右の 2 つの異なる部分で構成される大画面用のレイアウトを作成しています。そのためには、2 Fragments を使用するのが正しい選択だと思いました。
次に、 Master/Detail-Flowを使用したナビゲーションの例を確認しました。2 ペインのレイアウトで、右側がナビゲーション、左側が詳細ビューです。
しかし、その例では、私が期待していたものとは異なり、詳細ビューには、直接の代わりに , をFrameLayout
保持するがあります。Fragment
Fragment
レイアウト XML は次のようになります (例)。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal"
android:orientation="horizontal"
android:showDividers="middle"
tools:context=".WorkStationListActivity" >
<fragment
android:id="@+id/workstation_list"
android:name="de.tuhh.ipmt.ialp.history.WorkStationListFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
tools:layout="@android:layout/list_content" />
<FrameLayout
android:id="@+id/workstation_detail_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
私の質問は次のとおりです。詳細ビューに 自体ではFrameLayout
なく が使用されるのはなぜですか? Fragment
理由やメリットは?私も使うべきですか?