【问题标题】:Android tab layout placing tab at screen's buttom [duplicate]Android选项卡布局将选项卡放置在屏幕按钮[重复]
【发布时间】:2011-06-23 17:16:41
【问题描述】:

可能重复:
Android: Tabs at the BOTTOM

我想将选项卡布局的选项卡放在屏幕的底部,就像 iPhone 一样。 我该怎么做?

【问题讨论】:

    标签: android android-layout


    【解决方案1】:

    参考下面的 xml ... 现在如果你想把你的选项卡放在底部,只需将你的 tabwidget 移动到 Framelayout 下方(相对地),因为 tabwidget 和 Framelayout 在相对布局内。

        <TabHost xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@android:id/tabhost" android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <RelativeLayout
                android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TabWidget android:id="@android:id/tabs"
                    android:layout_alignParentBottom="true"
                    android:background="#FFFFFF"
                    android:layout_width="fill_parent" android:layout_height="wrap_content"
                    android:layout_marginLeft="0dip" android:layout_marginRight="0dip" />
                <FrameLayout android:id="@android:id/tabcontent"
                    android:background="#00FFFF"
                    android:layout_width="fill_parent" android:layout_height="wrap_content" />
            </RelativeLayout>
        </TabHost>
    
    </LinearLayout>
    

    【讨论】:

      猜你喜欢
      • 2023-03-09
      • 1970-01-01
      • 2017-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-23
      • 1970-01-01
      相关资源
      最近更新 更多