我想在IconButton
的标题下面有一个AppBar
。我试过了,但我有问题,中心的所有项目在那里和溢出的底部。
我的代码:
appBar: new AppBar(
title: Column(
children: <Widget>[
new Text('App Title'),
IconButton(
icon: new Icon(new IconData(0xe902, fontFamily: 'Ionicons')),
onPressed: () {},
)
],
),
centerTitle: true,
actions: <Widget>[
IconButton(
icon: new Icon(new IconData(0xe906, fontFamily: 'Ionicons')),
onPressed: () {},
)
],
),
It should looks like this.
最佳答案
你可以试试这个
appBar: AppBar(
centerTitle: true,
title: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("App Title"),
GestureDetector(
child: Icon(Icons.keyboard_arrow_down),
onTap: () {
// handle your click here
},
)
],
),
),
截图:
关于flutter - 如何使用标题下面的图标制作AppBar?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53903898/