我刚刚开始开发应用程序,并且在导航栏中苦苦挣扎。底部的一个很好,但顶部的一个不好。我想删除按钮上方的灰色空间。
你能帮助我吗?
[图片]

码:
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
backgroundColor: Colors.grey,
bottom: new TabBar(
controller: controller,
tabs: <Tab>[
new Tab(icon: new Icon(Icons.arrow_forward)),
new Tab(icon: new Icon(Icons.arrow_downward)),
new Tab(icon: new Icon(Icons.arrow_back)),
]
)
),
body: new TabBarView(
controller: controller,
children: <Widget>[
new first.First(),
new second.Second(),
new third.Third(),
new fourth.Fourth(),
new fifth.Fifth()
]
),
);
}
Run Code Online (Sandbox Code Playgroud)
Appbar那就不要使用。使用Card海拔高度为26.0的。您想要的是自定义应用栏:
final tab = new TabBar(tabs: <Tab>[
new Tab(icon: new Icon(Icons.arrow_forward)),
new Tab(icon: new Icon(Icons.arrow_downward)),
new Tab(icon: new Icon(Icons.arrow_back)),
]);
return new Scaffold(
appBar: new PreferredSize(
preferredSize: tab.preferredSize,
child: new Card(
elevation: 26.0,
color: Theme.of(context).primaryColor,
child: tab,
),
),
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5619 次 |
| 最近记录: |