flutter - 如何隐藏/删除 Flutter 应用程序上的标题栏?
问题描述
如何删除颤振栏上的标题栏?
displayMap() {
mapView.show(new MapOptions(
mapViewType: MapViewType.normal,
initialCameraPosition:
new CameraPosition(new Location(11.052992, 106.681612), 3.0),
showUserLocation: false,
title: 'Google Map'));
.....
}
我尝试添加Container(height: 0.0)
和删除title: 'Google Map'
,但它只删除“谷歌地图”文本。
编辑:
我的Scaffold
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Demo App'),
),
body: new Center(
child: Container(
child: RaisedButton(
child: Text('Touch'),
color: Colors.blue,
textColor: Colors.white,
elevation: 7.0,
onPressed: displayMap,
),
),
),
);
}
解决方案
在你的Scaffold
你需要删除你的appBar
财产:
return Scaffold(
//delete your appBar property in your related Scaffold.
body: YourBodyWidget(),
);
编辑:它与map_view
插件有关
MapOptions(
{this.showUserLocation: false,
this.showMyLocationButton: false,
this.showCompassButton: false,
this.hideToolbar = false,
this.initialCameraPosition: _defaultCamera,
this.title: "",
this.mapViewType: MapViewType.normal});
这些是默认设置,MapOptions
您可以尝试设置hideToolbar:true
,但我认为这不是您想要的,
我认为他们没有提供关闭参数appBar
,
最后我推荐使用google_maps_flutter插件,这个插件只渲染地图,由Flutter Team开发,因此您可以轻松地在页面/脚手架中配置其他人员。
推荐阅读
- c# - 什么存档文件格式有利于分布式处理期间的随机访问?
- rust - 方法 for_each 存在,但使用 StreamDeckSocket 时不满足 trait bound
- c++ - 删除构造函数和模板
- flutter - Flutter FadeIn/FadeOut animation together
- reactjs - 更新 redux 状态/提交表单时页面重新加载
- qt - 为什么不同的treeItems链接到相同的数据
- c++ - 使用变量定义数组大小和使用新运算符 c++ 有什么区别?
- node.js - Sequelize count fn add where 子句
- ios - iOS:间歇性缓慢的网络请求
- c# - UWP 更改 MasterView 中 ListView DataTemplate 的样式