【问题标题】:How to change the status bar color to white and also the status bar text color to black in flutter?如何将状态栏颜色更改为白色,并将状态栏文本颜色更改为黑色?
【发布时间】:2020-06-28 17:32:13
【问题描述】:

如何将状态栏颜色更改为白色,同时更改状态栏的文本颜色,否则两者都是白色,因此文本将不可见

【问题讨论】:

  • 尝试向我们展示您的尝试,以便您获得合适的帮助

标签: flutter statusbar


【解决方案1】:

你可以使用。你应该把它放在你的 main() 方法中。

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    statusBarColor: Colors.white
));

然后将您的 AppBar 亮度设置为

    AppBar(
      brightness: Brightness.light,
    ),

【讨论】:

  • 但是由于状态栏中的所有内容都是白色的,所以状态栏中的所有内容都变得不可见。
猜你喜欢
  • 2017-08-16
  • 1970-01-01
  • 2015-03-05
  • 1970-01-01
  • 2017-02-22
  • 1970-01-01
  • 2021-06-18
  • 1970-01-01
相关资源
最近更新 更多