- 解决SwipeRefreshLayout 和ListView 刷
- listview和swipeRefreshLayout冲突的解决
- SwipeRefreshLayout嵌套Listview冲突解决
- 自己做ListView的下拉刷新和自动加载更多
- 基于ListView和SwipeRefreshLayout的刷新
- 解决listview与SwipeRefreshLayout滑动冲
- android使用SwipeRefreshLayout实现下拉刷
- ListView嵌套RecyclerView,滑动不流畅
- 一个实现上拉加载更多的 SwipeRefreshLoadLayo
- SwipeRefreshLayout 自定义 canChildS
解决SwipeRefreshLayout 和ListView、 ExplandListView、 GirdView等AbsListView下拉冲突
本人遇到的问题是:SwipeRefreshLayout 中放了一个LinearLayout ,LinearLayout中才放的ExpandableListView,导致刷新的时候列表下拉不下来,该问题的原因就在于,ExpandableListView的外边又套了一层LinearLayout,
而当SwipeRefreshLayout中的直接子类 不是AbsListView等时,这时冲突就出现了,解决的办法如下
public void onScroll(AbsListView listView, intfirstVisibleItem, intvisibleItemCount, inttotalItemCount) {
boolean enable = false;
if (listView != null && listView.getChildCount() > 0) {
boolean firstItemVisible = listView.getFirstVisiblePosition() == 0;
boolean topOfFirstItemVisible = listView.getChildAt(0).getTop() == 0;
enable = firstItemVisible && topOfFirstItemVisible;
}
mSwipeRefreshLayout.setEnabled(enable);//通过滚动时动态判断是达到顶部来屏蔽SwipeRefreshLayout
}
网友评论