[英]How to make able to scroll ListView inside SingleChildScrollView?
How to make able to scroll listview inside SingleChildScrollView
?如何能够在
SingleChildScrollView
中滚动列表视图?
That's right, normally the list view scrolls even if the parent is a SingleChildScrollView
.没错,即使父级是
SingleChildScrollView
,列表视图通常也会滚动。
But my case is special because I used但我的情况很特别,因为我用过
NotificationListener<ScrollNotification>(
onNotification: (ScrollNotification notification) {
if (notification is UserScrollNotification) {
if (notification.direction == ScrollDirection.forward) {
//trigger doing some event ...
...changing screen because of this event
So my Listview scrolling is absolutely doing nothing and changing the screen because of the parent event.因此,由于父事件,我的 Listview 滚动绝对没有任何作用并改变了屏幕。
child: ListView.builder( ... // when scroll it doesn`t scroll and change screen because of parent
Can anyone solve this?谁能解决这个问题?
I think you have not provided the physics property for the list view: Use -> physics:AlwaysScrollableScrollPhysics()
for the listview to make it scrollable.我认为您没有为列表视图提供 physics 属性:使用 ->
physics:AlwaysScrollableScrollPhysics()
使列表视图可滚动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.