Flutter 如何在 Listview.builder、SingleChildScrollView 等可滚动小部件中隐藏滚动条(拇指)

时间:2021-05-23 16:41:37

标签: flutter flutter-layout scrollbar

有没有办法从 SingleChildScrollViewListview.builder 中删除滚动条?最新更新后,它滚动时自动出现(平台 Windows)。

我已经尝试过这个解决方案:

 NotificationListener<ScrollNotification>(
     onNotification: (_) => true,
     child: ...,
    );

并且还尝试使用 isAlwaysShown 和控制器将我的小部件树包装在滚动条小部件中,但两种变体都不起作用。

Still here

1 个答案:

答案 0 :(得分:0)

要隐藏桌面/网络上的滚动条,请将您的小部件树包装在具有 ScrollConfiguration.of(context).copyWith(scrollbars: false) 行为的 ScrollConfiguration 小部件中,

 ScrollConfiguration(
      behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
      child: ...,),