如何使设备顶部面板(状态栏)的背景颜色与AppBar在扑打中的颜色相同? [英] How to make device top panel (status bar) have the same background color as AppBar in flutter?

查看:162
本文介绍了如何使设备顶部面板(状态栏)的背景颜色与AppBar在扑打中的颜色相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使设备顶部面板(状态栏)的背景颜色与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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆