繁体   English   中英

如何能够在 SingleChildScrollView 中滚动 ListView?

[英]How to make able to scroll ListView inside SingleChildScrollView?

如何能够在SingleChildScrollView中滚动列表视图?

没错,即使父级是SingleChildScrollView ,列表视图通常也会滚动。

但我的情况很特别,因为我用过

NotificationListener<ScrollNotification>(
      onNotification: (ScrollNotification notification) {
        if (notification is UserScrollNotification) {
          if (notification.direction == ScrollDirection.forward) {
                //trigger doing some event ...
                ...changing screen because of this event

因此,由于父事件,我的 Listview 滚动绝对没有任何作用并改变了屏幕。

child: ListView.builder( ... // when scroll it doesn`t scroll and change screen because of parent

谁能解决这个问题?

我认为您没有为列表视图提供 physics 属性:使用 -> physics:AlwaysScrollableScrollPhysics()使列表视图可滚动。

暂无
暂无

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

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