Android:选项卡中的选项卡
我目前正试图根据客户的规格创建一个应用程序,其中包括一个双选项卡集 这意味着用户需要在底部的选项卡中单击,例如在第一个选项卡中,他还将在顶部看到一组选项卡,可以在其中单击(但在这些选项卡中单击时,只有顶部的选项卡将更改,而底部的选项卡将保持不变) 我如何用安卓系统实现这一点? 到目前为止,我只能实现普通选项卡创建根项“TabHost”,如下所示:Android:选项卡中的选项卡,android,android-layout,tabs,Android,Android Layout,Tabs,我目前正试图根据客户的规格创建一个应用程序,其中包括一个双选项卡集 这意味着用户需要在底部的选项卡中单击,例如在第一个选项卡中,他还将在顶部看到一组选项卡,可以在其中单击(但在这些选项卡中单击时,只有顶部的选项卡将更改,而底部的选项卡将保持不变) 我如何用安卓系统实现这一点? 到目前为止,我只能实现普通选项卡创建根项“TabHost”,如下所示: <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="htt
<?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" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true" >
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</TabHost>
提前多谢 多亏了ActionBar(和SherlockActionBar,适用于蜂巢前设备),我发现了这一点: 还有:
为什么不能在活动的布局文件中设置tabhost,该文件将在选择tab-1时加载?将活动\u-1设置为tab-activity,您会发现第二个tabhost正在工作。@Hiral抱歉,我不明白您的答案。我该怎么办?当你点击其中一个选项卡时,你就开始了一个活动,对吗?在这个活动中,你会有一个布局文件。我告诉过你也要有tabhost,这样当你加载activity时,它会在选项卡中给你选项卡。@Hiral为所有这些创建片段会更简单吗?对不起,我还没有使用片段!