2016-04-26 39 views
1

我有一个应用程序SwipeRefreshLayout它有一个ListView里面。当填充ListView时,我可以轻松地向下滚动以阅读列表中较旧的项目,但是当我尝试向上滚动此操作时,即使我尝试向上滚动,也会误认为是Pull2Refresh操作。无论我将手指放在哪里,它仍然会错误地执行Pull2Refresh操作。我怎样才能排序这个问题,因为滚动回顶部是一个问题。

这里是XML到片段与SwipeRefreshLayout
SwipeRefreshLayout不允许我向上滚动

<android.support.v4.widget.SwipeRefreshLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/swipe_refresh_layout_general" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.inc.automata.unamupdates.fragments.GeneralNewsFragment"> 

    <ListView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/listViewGeneral"> 
    </ListView> 
    </FrameLayout> 
</android.support.v4.widget.SwipeRefreshLayout> 

回答

0

尝试在列表视图

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.inc.automata.unamupdates.fragments.GeneralNewsFragment"> 

    <ListView 
     android:id="@+id/listViewGeneral" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:smoothScrollbar="true" 
     android:fadeScrollbars="true"></ListView> 

</FrameLayout> 

+0

使用follwoing属性仍然不起作用 – Manny265

+0

的ListView里面SwipeRefreshLayout,在FrameLayout中,不起作用? – maja89