flutter - 设置手势栏颜色透明[Flutter]
问题描述
我需要将导航栏设置为透明,但不隐藏。如左侧 Youtube Music 的示例。
我尝试了几种方法,每当我将它定义为透明时,条都是白色的。
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
systemNavigationBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
));
请看右边的图片。我只需要白色部分是透明的,手势指示器需要保持可见。有人能帮我吗?
解决方案
将您的导航栏放在容器中。然后不给容器颜色,它会自动将颜色设置为透明。要将容器与底部对齐,您可以这样做。希望这会起作用。
扑
Align(
alignment: Alignment.bottomLeft,
child: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
],
),
),
)
推荐阅读
- dart - Flutter:在后台获取地理位置
- php - 如何在 PHP Simple HTML DOM Parser 中格式化纯文本?
- html - 有没有办法嵌入 facebook 视频并在非移动设备上播放声音?
- .net - BindingOperations.GetBinding 给出另一个绑定
- c# - 有没有办法可以减少使用的 if 语句的数量?
- html - 在全宽 div 中左对齐文本
- angular - 在不使用 navpush 的情况下传递多个数据
- lua - 如何在lua中设置事件之间的时间间隔
- logstash - Filebeat无法连接到logstash
- django - MEDIA_ROOT 错误:_getfullpathname:路径应该是字符串、字节或 os.PathLike,而不是元组