Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

状态栏字体颜色和uniapp不兼容 #50

Open
hdtopku opened this issue May 6, 2022 · 2 comments
Open

状态栏字体颜色和uniapp不兼容 #50

hdtopku opened this issue May 6, 2022 · 2 comments

Comments

@hdtopku
Copy link

hdtopku commented May 6, 2022

定义状态栏字体颜色为白色
如下,main.js中注释掉,状态栏字体是白色的
image

打开注释以后,状态栏字体始终为黑色
image

@hdtopku
Copy link
Author

hdtopku commented May 6, 2022

pages.json配置如下

{
  "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
    {
      "path": "pages/index/index",
      "style": {
        "navigationBarTitleText": "uni-app"
      }
    }
  ],
  "globalStyle": {
    // "navigationBarBackgroundColor": "#000",
    "navigationStyle": "custom", // 隐藏系统导航栏
    "navigationBarTextStyle": "white" // 状态栏字体为white或black
  }
}

暂时的解决方案
src/ui/index.js中注释掉主题设置

import Vue from 'vue'
import store from '@/ui/store'
import modal from '@/ui/js/modal.js'
import request from '@/ui/js/request.js'
import util from '@/ui/js/util.js'
import mixin from '@/ui/js/mixin.js'
import app from "@/app/index.js"

if (uni.getStorageSync("VUE_APP_NAME") != process.env.VUE_APP_NAME) {
	uni.clearStorage();
	uni.setStorageSync('VUE_APP_NAME', process.env.VUE_APP_NAME);
}

/*分析主题*/
var theme = uni.getStorageSync("sys_theme");
var main = uni.getStorageSync("sys_main");
var text = uni.getStorageSync("sys_text");

if (!theme) {
	theme = store.getters.getCustomTheme;
}
if (!main) {
	main = store.getters.getCustomMain;
}
if (!text) {
	text = store.getters.getCustomText;
}
// store.commit('setTheme', theme);
store.commit('setMain', main);
store.commit('setText', text);

@iZaiZaiA
Copy link
Collaborator

iZaiZaiA commented May 7, 2022

好的,后续空了,再修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants