相关疑难解决方法(0)

在android中快速滚动时避免使用SwipeRefresh

我有一个ListView具有fastScroll始终处于启用状态和SwipeRefresh执行.当我向下滑动列表时,它会刷新列表.我的问题是fastScroll.如果列表的第一个项目可见或在其最初的顶部显示,那么如果向下滚动fastScrollThumb,它会产生Swipe效果而不是向下滚动.无论如何/解决方案,如果我按fastScrollThumb,然后它不应该做Swipe刷新效果,而是它应该向下滚动,因为它的自然行为.

在此输入图像描述

编辑XML Layout的如下:

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.v4.widget.SwipeRefreshLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/swipe_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <RelativeLayout
            android:id="@+id/buttons_layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="10dp"> 

            <ImageView
                android:id="@+id/SubmitButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/neoo_tab_selector" />

        </RelativeLayout>


        <ListView
            android:id="@id/android:list"
            style="@style/NeeoContactListView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/buttons_layout"
            android:layout_marginTop="10dp" />
    </RelativeLayout>

</android.support.v4.widget.SwipeRefreshLayout>
Run Code Online (Sandbox Code Playgroud)

Logic for onScroll启用/禁用的SwipeRefresh是:

    getListView().setOnScrollListener(new OnScrollListener() {

    @Override
    public void onScrollStateChanged(AbsListView view, int scrollState) {
    }

    @Override
    public …
Run Code Online (Sandbox Code Playgroud)

android android-listview fastscroll

6
推荐指数
1
解决办法
1863
查看次数

标签 统计

android ×1

android-listview ×1

fastscroll ×1