我有这个简单的布局,我发现作为一个例子:Android 2.3.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" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:fillViewport="true"
android:scrollbars="none" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center" />
</HorizontalScrollView>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</FrameLayout>
</LinearLayout>
</TabHost>
在代码中加入8个选项卡后,我可以看到他们得到挤在一起。 如何将可滚动功能添加到选项卡? (只是标签,而不是内容)
我的手机上的一个应用程序有这个,这也没有任何滚动条。基本上,要移动我只需按下并按住,然后将标签拖动到左侧以显示更多标签。这怎么能实现?
这也给了没有效果。使用之前的评论更新我的帖子。整个xml文件就是这个TabHost。 (这是主窗口) – Patrick