How to make device top panel (status bar) have the

2019-02-10 22:56发布

问题:

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.



标签: dart flutter