Answer the question
In order to leave comments, you need to log in
How to defeat ListView and swipeRefresh together?
Sorry for such a title...
I have such a problem.
There is a ListView which is in a RelativeLayout which is in android.support.v4.widget.SwipeRefreshLayout
The problem is that the ListView began to slowly increase and a scrollbar appeared.
When you scroll to the end, everything is fine, when the refresh icon immediately appears from the end to the beginning and the page is updated.
I would like to change the behavior to this, first the ListView scrolls to the top and only then the refresh icon pops up.
How to do it?
Answer the question
In order to leave comments, you need to log in
In my opinion, your problem is in RelativeLayout'e. You need to put the ListView directly in the SwipeRefreshLayout, then everything will work correctly.
<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"
>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_cls"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/cls_listView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question