您的位置:首页 > 大数据 > 人工智能

activity_main.xml页面放置TabHost控件,用于标题的选择。

2016-06-15 12:59 483 查看
activity_main.xml页面放置TabHost控件,用于标题的选择。

activity_main.xml页面


<RelativeLayout 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"

    tools:context=".MainActivity" >

    <TabHost 

        android:id="@android:id/tabhost"

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:layout_alignParentLeft="true"

        android:layout_alignParentTop="true">

        <LinearLayout 

            android:layout_width="match_parent"

            android:layout_height="match_parent"

            android:orientation="vertical">                      

            <FrameLayout 

            android:id="@android:id/tabcontent"

            android:layout_width="match_parent"

            android:layout_height="match_parent"

            android:layout_weight="1">

             <LinearLayout 

            android:id="@+id/tab1"

            android:layout_width="match_parent"

            android:layout_height="match_parent"

            android:orientation="vertical">

            </LinearLayout>

               <LinearLayout 

            android:id="@+id/tab2"

            android:layout_width="match_parent"

            android:layout_height="match_parent"

            android:orientation="vertical">

            </LinearLayout>

             <LinearLayout 

            android:id="@+id/tab3"

            android:layout_width="match_parent"

            android:layout_height="match_parent"

            android:orientation="vertical">

            </LinearLayout>

            </FrameLayout>  

            <TabWidget 

                android:id="@android:id/tabs"

                android:layout_width="match_parent"

                android:layout_height="wrap_content">             

            </TabWidget>                    

        </LinearLayout>

    </TabHost>

</RelativeLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: