【问题标题】:Flutter - SliverAppBar - How to show the AppBar as soon as user starts scrolling back upFlutter - SliverAppBar - 如何在用户开始向上滚动后立即显示 AppBar
【发布时间】:2020-10-29 09:29:27
【问题描述】:

我在 NestedScrollView 中有一个 SliverAppBar。这会在用户向下滚动屏幕时隐藏 AppBar,并在用户滚动回顶部时显示。

NestedScrollView(
  controller: _scrollViewController,
  headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
    return <Widget>[
      SliverAppBar(
        title: Text('Title'),
      ),
    ];
  },
    .......
)

目前,AppBar 在用户向上滚动时保持隐藏状态,仅在滚动几乎到达顶部时才会出现。我希望 AppBar 在用户开始向上滚动时立即出现。如何做到这一点?我试过浮动和固定属性。

【问题讨论】:

    标签: flutter


    【解决方案1】:

    将其浮动设置为真:

     floating: true
    

    您可以在here找到更多信息

    【讨论】:

      猜你喜欢
      • 2021-08-04
      • 2019-06-03
      • 1970-01-01
      • 2019-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-26
      • 1970-01-01
      相关资源
      最近更新 更多