如何使设备顶部面板(状态栏)的背景颜色与AppBar在扑打中的颜色相同? [英] How to make device top panel (status bar) have the same background color as AppBar in flutter?
问题描述
如何使设备顶部面板(状态栏)的背景颜色与AppBar在颤动中的颜色相同?设备顶部面板的颜色始终比AppBar backgroundColor暗。非常感谢。
在iOS上,这已经是真的。
在Android上,将以下内容添加到 MainActivity.java
中的 onCreate
中,在之后调用 super.onCreate(savedInstanceState);
。
getWindow() .setStatusBarColor(0x00000000);
这将覆盖默认状态栏颜色 0x40000000
,在
How to make device top panel (status bar) have the same background color as AppBar in flutter? The color of the device top panel is always darker than the AppBar backgroundColor. Thanks a lot.
On iOS, this is already true.
On Android, add the following to onCreate
in MainActivity.java
, after the call to super.onCreate(savedInstanceState);
.
getWindow().setStatusBarColor(0x00000000);
This will override the default status bar color of 0x40000000
, which is set in the onCreate
method of FlutterActivityDelegate
.
这篇关于如何使设备顶部面板(状态栏)的背景颜色与AppBar在扑打中的颜色相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!