S
S
semax952016-03-20 17:39:54
Android
semax95, 2016-03-20 17:39:54

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

2 answer(s)
D
Denis Zagaevsky, 2016-03-20
@zagayevskiy

In my opinion, your problem is in RelativeLayout'e. You need to put the ListView directly in the SwipeRefreshLayout, then everything will work correctly.

S
sergiu3dmd, 2016-03-21
@sergiu3dmd

<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 question

Ask a Question

731 491 924 answers to any question