自定义导航栏后,如何动态修改顶部状态栏颜色?

小程序 文章 2022-02-25 11:00 466 0 全屏看文

AI助手支持GPT4.0

自定义导航栏后,如何动态修改顶部状态栏颜色?After customizing the navigation bar, how to dynamically modify the top status bar color?

自定义导航栏后,如何动态修改顶部状态栏颜色?

做的项目需要有夜间模式,自定义导航栏后,这个页面的背景都是黑色,顶部状态栏(信号,电量等)字体颜色也是黑色,就完全看不见了.我用wx.setNavigationBarColor修改fontColor:'#ffffff',提示调用失败. 请问我该如何处理这个问题?

The project needs to have night mode. After customizing the navigation bar, the background of this page is black, and the font color of the top status bar (signal, power, etc.) is also black, so it is completely invisible I use Wx Setnavigationbarcolor modify fontcolor: '#ffffff', prompt call failed How should I deal with this problem?

回答:

Friver:

已经解决了.还是用xw.etNavigationBarColor=>fontColor:'#ffffff'. 因为我用的HBuilder.输入颜色的时候#ffffff自动提示为#FFFFFF.所以导致调用失败.

小黎:

不是自定义的么,为啥不能改颜色

Friver:顶部的信号,电量显示是系统自带的.要修改的是这部分的字体颜色.
brave:

在js里setData修改顶部导航的style样式啊,你都自定义了都

Friver:顶部的信号,电量显示是系统自带的.

-EOF-

AI助手支持GPT4.0