【问题标题】:Is there a way to place the appbar at the bottom in flutter?有没有办法将appbar放在底部?
【发布时间】:2018-10-14 09:19:14
【问题描述】:

有没有办法在颤动中将应用栏停靠在底部?

谢谢。

【问题讨论】:

    标签: flutter dock appbar


    【解决方案1】:

    AppBar 只是一个和其他小部件一样的小部件。你可以把它放在任何你想要的地方。

    即使在ScaffoldbottomNavigationBar 字段中。

    final appBar = new AppBar(title: new Text("data"));
    return new Scaffold(
      body: new Center(
        child: new FlatButton(
          child: new Text("data"),
        ),
      ),
      bottomNavigationBar: new SizedBox(
        height: appBar.preferredSize.height,
        child: appBar,
      ),
    );
    

    虽然在这种情况下你也可以使用BottomAppBar

    【讨论】:

    • 我尝试了bottomNavigationBar,但它所做的是将appBar的底部边缘一直拉到底部,儿子现在它填满了整个屏幕。这是我正在使用的示例,我试图将其放在底部,BottomAppBar 没有与 AppBar 相同的属性,因此它不起作用。 flutter.io/catalog/samples/app-bar-bottom
    猜你喜欢
    • 2021-09-10
    • 1970-01-01
    • 1970-01-01
    • 2017-09-13
    • 2021-10-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    相关资源
    最近更新 更多