应用主动设置深浅色模式,如果应用调用setColorMode接口主动设置了深浅色,则以接口效果优先。应用没有调用setColorMode接口时:如果应用工程dark目录下有深色资源,则系统内置组件在深色模式下会自动切换成为深色。如果应用工程dark目录下没有任何深色资源,则系统内置组件在深色模式下仍会保持浅色体验。请参考以下文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-light-dark-color-adaptation-V5\#section19361879317可以在EntryAbility.ets中修改状态栏的颜色;(await windowStage.getMainWindow()).setWindowSystemBarProperties({ // 设置状态栏颜色为其他颜色 statusBarColor: '#ffa28d8f', // 设置状态栏文本颜色为白色 statusBarContentColor:'#ffe30520' })
应用主动设置深浅色模式,如果应用调用setColorMode接口主动设置了深浅色,则以接口效果优先。
应用没有调用setColorMode接口时:如果应用工程dark目录下有深色资源,则系统内置组件在深色模式下会自动切换成为深色。
如果应用工程dark目录下没有任何深色资源,则系统内置组件在深色模式下仍会保持浅色体验。请参考以下文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-light-dark-color-adaptation-V5\#section19361879317
可以在EntryAbility.ets中修改状态栏的颜色;