Android SwipeRefreshLayout with empty TextView not working properly

后端 未结 4 1634
旧巷少年郎
旧巷少年郎 2021-01-12 08:36

What i want to do is , allow user to swipe and refresh the list, it does not matter if the data is there or not. But when data is there in the listview only the listview sho

4条回答
  •  萌比男神i
    2021-01-12 08:47

    My issue seems to be undocumented, but if the adapter for a recycler view has no data, and you have called the setLayoutManager function, then the recycler view becomes un-swipeable. My solution was to only call setLayoutManager after some data had been received.

提交回复
热议问题