0

GoogleのFragmentTabsPager.javaを使用してサンプルアプリを作成したいのですが、このコードのXMLが見つかりません。このFragmentTabsPager.javaのレイアウトファイルを知っている人はいますか?。または、サンプルアプリを実現するためのガイドはありますか?

4

1 に答える 1

0

そのコードのレイアウトを見つけました。

<TabHost 
            android:id="@android:id/tabhost"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            >
            <LinearLayout 
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                >

                <TabWidget 
                    android:id="@android:id/tabs"
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:weightSum="0"
                    />

                <FrameLayout 
                    android:id="@android:id/tabcontent"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="0"
                    />

                <android.support.v4.view.ViewPager
                    android:id="@+id/viewpager"
                    android:layout_width="fill_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:padding="10dp"
                    />

            </LinearLayout>
        </TabHost>

それはうまくいきます。

于 2012-05-24T09:42:33.220 に答える