【发布时间】:2011-10-23 19:27:46
【问题描述】:
我的列表中有五个选项卡,当 TabActivity 启动时你可以看到前三个选项卡,然后如果我向右滚动,另外两个也会显示出来。我遇到的问题是接下来的两个选项卡需要点击两次才能启动,如果屏幕中显示最后三个选项卡,则前两个选项卡反之亦然。
如果有人知道如何解决这个烦人的问题,我将不胜感激。
提前致谢!
编辑:
我发现真正的问题是当我滚动到结尾(向左或向右)时,会导致任何选项卡被点按两次才能工作,有人知道吗?我发现滚动到最后(向右或向左)时可以点击一次,但只能在 3 秒后。如果我立即点击,则需要再次点击才能工作。
我的代码(xml):
<?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:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<HorizontalScrollView
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000000"/>
</HorizontalScrollView>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
【问题讨论】:
标签: android android-tabhost tabwidget