簡體   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