简体   繁体   English

如何能够在 SingleChildScrollView 中滚动 ListView?

[英]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.

相关问题 如何在flutter中使用SingleChildScrollView使listview滚动 - How to make listview scroll with SingleChildScrollView in flutter 如何使用 SingleChildScrollView 使 Stack 布局可滚动? - How to make Stack layout scroll-able using SingleChildScrollView? 如何在 SingleChildScrollView 中使用 Listview? - How to use Listview inside SingleChildScrollView? 如何使用嵌套的 ListView 制作 SingleChildScrollView? - How to make a SingleChildScrollView with nested ListView? 如何同步 singlechildscrollview 和 listview flutter 的滚动? - how to sync scroll of singlechildscrollview and listview flutter? 如何在 SingleChildScrollView 中实现不可滚动的列表视图 - How to implement a Non scrollable listview inside a SingleChildScrollView 如何在 Flutter 的 SingleChildScrollView 内滚动小部件? - How to scroll a widget inside a SingleChildScrollView in Flutter? 如何滚动到 flutter web 中 SingleChildScrollView 内的小部件? - How to scroll to a widget inside the SingleChildScrollView in flutter web? 即使在SingleChildScrollView或ListView中添加内容也无法获得页面滚动 - Unable to get page scroll even adding the content inside a SingleChildScrollView or the ListView 滚动侦听器不适用于 SingleChildScrollView Flutter 中的列表视图 - Scroll listener doesn't work for listview inside a SingleChildScrollView Flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM