【问题标题】:Horizontal scrollview scroll changes tab focus水平滚动视图滚动更改选项卡焦点
【发布时间】:2014-07-20 19:22:46
【问题描述】:

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

为了阻止这种情况,我试图处理滚动视图的 ontouchevent,它滚动标签并返回 true。但不能完全正确地做到这一点。

有人可以帮忙吗?

提前致谢!

【问题讨论】:

标签: android android-tabhost tabwidget horizontalscrollview


【解决方案1】:

在标签 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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多