Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在CoordinatorLayout中使用问题 #13

Open
JaminFan opened this issue Dec 26, 2016 · 4 comments
Open

在CoordinatorLayout中使用问题 #13

JaminFan opened this issue Dec 26, 2016 · 4 comments

Comments

@JaminFan
Copy link

我按照demo里面的activity_coo的写法,在CoordinatorLayout中使用刷新控件,唯一不同的是我使用的是listview,我现在有这样的问题,要一次性滑动到底才能到达底部,如果在中间部分停止了,就不能滑动到底部了,直接就触发了上拉加载,请问应该如何解决这个问题?

@canyinghao
Copy link
Owner

CoordinatorLayout 中需要使用继承于NestedScrollingChild的控件,RecyclerView或者NestedScrollView。所以建议你换成RecyclerView,它比listview更强大更好用,我早已弃用了listview。

@JaminFan
Copy link
Author

我的listview是继承NestedScrollingChild的,我试了使用RecyclerView,但是发现问题还是存在,只能一次性滑动到底部,在中间部分停止了,就不能滑动到底部了,直接就触发了上拉加载。

@canyinghao
Copy link
Owner

要加上app:layout_behavior属性,setNestedScrollingEnabled不能设置为false。

@JaminFan
Copy link
Author

找到问题的原因了,RecyclerView是可以实现需求的,第一次不能使用是因为我布局问题,listview时需要把listview放在NestedScrollView下,第一次使用时没有把NestedScrollView去掉,导致出现一样的问题,后面我重新写了布局,就可以了。谢谢解答。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants