ログインビューを設計します。親ビューの中央に配置されたフラグメントレイアウトを挿入したいと思います。この効果を実現するために、フラグメントレイアウトを入力するようにハードコーディングします。しかし、これを行うためのより良い方法はありますか?
これは私のレイアウトです:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="2"
android:orientation="horizontal">
<FrameLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1">
</FrameLayout>
<FrameLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="2">
</FrameLayout>
<FrameLayout
android:id="@+id/login_frame"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1">
</FrameLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
</FrameLayout>
</LinearLayout>
ありがとうございます。