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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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
.