1

我不知道如何在底部制作一个 SliverAppBar。我希望它在滚动时不会消失,我试过但它只会显示在滚动的底部。

4

2 回答 2

2

我确实用这个弄明白了:D

bottomNavigationBar: BottomAppBar(
          child: Row(
            children: [
              IconButton(icon: Icon(Icons.menu), onPressed: () {}),
              Spacer(),
              IconButton(icon: Icon(Icons.search), onPressed: () {}),
              IconButton(icon: Icon(Icons.more_vert), onPressed: () {}),
            ],
          ),
        ),

脚手架内

抱歉,我以为 SliverAppBar 和所有 AppBar 一样,这里是 NOOB

于 2020-12-09T07:52:56.767 回答
0

在 SliverAppBar 内启用浮动属性true。例如:

CustomScrollView(
slivers: <Widget>[
 SliverAppBar(
   title: Text('Floating app bar'),
   // Allows the user to reveal the app bar if they begin scrolling back
   // up the list of items.
   floating: true,
   // Display a placeholder widget to visualize the shrinking size.
   flexibleSpace: Placeholder(),
   // Make the initial height of the SliverAppBar larger than normal.
   expandedHeight: 200,
 ),
],
);
于 2020-12-09T07:42:29.633 回答