简体   繁体   English

使用滚动视图取消了子回收者视图吗?

[英]Is using a scroll view cancelling a child recycler view?

I have read that using ScrollView generally is not a good idea. 我已经读过,使用ScrollView通常不是一个好主意。
But I have a custom view that takes eg 300dp width and bellow it a recycler view. 但是我有一个自定义视图,该视图需要300dp的宽度,然后将其称为回收站视图。
If I do not add these in a ScrollView the recycler view takes only what's left of the 300dp. 如果我不将这些添加到ScrollView则回收器视图仅使用300dp的剩余空间。
So in this case is using ScrollView correct or it somehow cancels out the benefit of using a recycler view? 所以在这种情况下使用ScrollView正确的还是以某种方式抵消了使用回收站视图的好处?

为了获得更好的滚动行为,您将需要为RecyclerView设置嵌套滚动,但如果在NestedScrollView使用它,它仍将回收视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM