【发布时间】:2012-12-17 05:15:18
【问题描述】:
我正在研究使用片段处理选项卡。我想知道如何将 TabWidget 放在页面底部。
我正在研究 FragmentTab.java 示例(支持库 v4)。
有一个 XML 布局:
<android.support.v4.app.FragmentTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TabWidget
android:id="@android:id/tabs"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0"/>
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
无论我做什么 TabWidget 仍然是最重要的。实际上我可以完全删除 TabWidget 标签,但项目仍然会成功启动,并且 TabWidget 会再次出现在顶部。
这是否意味着现在使用 FragmentActivity 和 FragmentTabHost 我只能让我的 TabWidget 在顶部?
谢谢。
【问题讨论】:
-
你有什么解决办法吗?
标签: android tabs fragment tabwidget android-fragmentactivity