Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 水平滚动视图滚动更改选项卡焦点_Android_Android Tabhost_Tabwidget_Horizontalscrollview - Fatal编程技术网

Android 水平滚动视图滚动更改选项卡焦点

Android 水平滚动视图滚动更改选项卡焦点,android,android-tabhost,tabwidget,horizontalscrollview,Android,Android Tabhost,Tabwidget,Horizontalscrollview,我在水平滚动视图中有一个选项卡小部件。我遇到的问题是,当我在scroll视图中滚动时,tab小部件中的当前选项卡会发生更改,并且由于执行了此ontabchange事件处理程序 为了阻止这种情况,我试图处理scrollview的ontouchevent,它可以滚动选项卡并返回true。但不能很好地做到这一点 有人能帮忙吗 提前谢谢 在xml选项卡中尝试此操作 <HorizontalScrollView android:layout_width="fill_parent" an

我在水平滚动视图中有一个选项卡小部件。我遇到的问题是,当我在scroll视图中滚动时,tab小部件中的当前选项卡会发生更改,并且由于执行了此ontabchange事件处理程序

为了阻止这种情况,我试图处理scrollview的ontouchevent,它可以滚动选项卡并返回true。但不能很好地做到这一点

有人能帮忙吗

提前谢谢

在xml选项卡中尝试此操作

<HorizontalScrollView
    android:layout_width="fill_parent"
    android:layout_height="200dp">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="200dp"
        android:orientation="horizontal">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/src" />

    </LinearLayout>
</HorizontalScrollView>

看看这个。我切换到夏洛克行动吧,它解决了我所有的问题:)