flutter - 如何在 Ios 上更改状态栏文本颜色
问题描述
我对所有这些颤动的东西都很陌生。我到处寻找解决这个小问题的方法。有没有办法改变状态栏的颜色?此外,当我使用 color.blue 之类的颜色时,我可以看到状态栏中的文本质量不好。
谢谢
appBar: AppBar(
elevation : 0.0,
leading: IconButton(
icon: Icon(Icons.menu),
tooltip: 'Navigation menu',
onPressed: null,
),
actions: <Widget>[
IconButton(
icon: Icon(Icons.search),
tooltip: 'Search',
onPressed: null,
),
],
),
解决方案
@Antoine 基本上你可以设置你的主题亮度,或者你可以使用以下方法手动覆盖应用栏亮度:
appBar: new AppBar(
title: new Text(widget.title),
brightness: Brightness.light, // or use Brightness.dark
),
请注意,这只会在白色和黑色状态文本颜色之间切换。
.dark
将使状态栏文本变为白色,而.light
将状态栏文本变为黑色。
也许对于更自定义的颜色,就像评论说你可以查看 SystemChrome 类。
推荐阅读
- kubernetes - 动态持久卷调整大小
- flutter - Flutter_Swiper Carousel 将分页指示器显示为条形
- google-workflows - 如何在工作流中获取执行 ID
- azure - Azure Purview 支持 ADF 数据流中的 Delta 格式接收器
- python - 如何让 Python 使闰年函数类似于范围(开始、停止、步进)?
- elasticsearch - 弹性搜索 NEST (.net) SQL
- spyder - 在 Spyder IDE 中获取 github 的暗模式
- amazon-cognito - 我想从托管的 ui 中删除注册流程,但希望将其保留在我使用 SDK 的应用程序中。我该怎么做
- node.js - 大家好:我在 nodejs 中启动 Sails 应用程序时遇到问题。任何人都可以提出他们的见解吗?
- php - 当 sql_mode=only_full_group_by 时,在 mysql 中完成 Group By 工作的最佳方法是什么