【问题标题】:How to set tab bar at the bottom in android?如何在android的底部设置标签栏?
【发布时间】:2011-06-28 04:36:58
【问题描述】:

我在 android 中使用标签栏。

默认显示在顶部。

我希望它显示在底部。

有人可以解释一下如何做到这一点吗?

【问题讨论】:

    标签: android tabbar


    【解决方案1】:

    请查看此链接:How to align your TabHost at the bottom of the screen

    为 TabWidget 添加 android:layout_alignParentBottom="true" 就可以了。

    【讨论】:

    • 是否可以在 ActionBarActivity 中使用 TabHost?
    【解决方案2】:

    只需将内容布局放在选项卡小部件上方。 有关更多信息,请参见以下链接。 Android: Tabs at the BOTTOM

    【讨论】:

      【解决方案3】:
      <?xml version="1.0" encoding="utf-8"?>
      <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"
          android:padding="1dp" >
      
          <RelativeLayout
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:orientation="vertical"
              android:padding="5dp" >
      
              <FrameLayout
                  android:id="@android:id/tabcontent"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:padding="5dp" />
      
              <TabWidget
                  android:id="@android:id/tabs"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_alignParentBottom="true" />
          </RelativeLayout>>
      
      </TabHost>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-03-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多