On a ListView
, the SwipeRefreshLayout
works fine. However, on a LinearLayout
only (without ListView
) the behaviour is bizarre. The SwiperefreshLayout's
progress bar doesn't appear completely, in fact, it just appears for a fraction of second. What can the issue be?
Asked
Active
Viewed 5,497 times
16

sHOLE
- 343
- 4
- 15

vinay vyas
- 491
- 1
- 4
- 17
1 Answers
33
In your LinearLayout
which is inside the SwipeRefreshLayout
, set android:clickable="true"
<LinearLayout
android:id="@+id/dummy_view"
android:clickable="true"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">

sHOLE
- 343
- 4
- 15

Ishaan Garg
- 3,014
- 3
- 25
- 28
-
2Yes it works, but why we need to set clickable=true? – Ajit Singh Mar 10 '16 at 18:40
-
Yeah worked for me too. why was it so that when you add `clickable` the `SwipeRefreshLayout` works? – patrickjason91 Jun 10 '16 at 01:54
-
This did work for me as well. Just wondering what must be the actual reason for this working. – Makarand Aug 03 '16 at 18:22