【发布时间】:2011-06-28 04:36:58
【问题描述】:
我在 android 中使用标签栏。
默认显示在顶部。
我希望它显示在底部。
有人可以解释一下如何做到这一点吗?
【问题讨论】:
我在 android 中使用标签栏。
默认显示在顶部。
我希望它显示在底部。
有人可以解释一下如何做到这一点吗?
【问题讨论】:
请查看此链接:How to align your TabHost at the bottom of the screen
为 TabWidget 添加 android:layout_alignParentBottom="true" 就可以了。
【讨论】:
只需将内容布局放在选项卡小部件上方。 有关更多信息,请参见以下链接。 Android: Tabs at the BOTTOM
【讨论】:
<?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>
【讨论】: