ionic-framework - Ionic 4. 如何更改旧 android 版本的标题背景颜色
问题描述
我尝试为此使用css变量
ion-toolbar {
--background: #{$backgroundColor3};
--min-height: #{$spacing * 5};
}
在最新的 chrome 和 android 8 上一切正常。但在带有 chrome 40.* 的 adnroid 5 上它不起作用。
我发现 Ionic 的最小 android 版本是 4.4文档
>ionic info
Ionic:
Ionic CLI : 5.0.1
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 9 other plugins)
Utility:
cordova-res : 0.3.0
native-run : 0.2.5
System:
Android SDK Tools : 26.1.1 (C:\Android)
NodeJS : v11.14.0 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10
背景只是样式的一个问题:
来自 android 5 的问题的屏幕截图
普通截图
解决方案
您需要在全局或页面 .scss 文件中使用添加
--background: var(--ion-color-primary);
这是你的答案。
推荐阅读
- r - .Rproj 文件从 R CMD CHECK 环境中的项目目录中消失
- android - 我在发布模式下使用改造收到空响应,但在调试模式下一切正常
- sql - 将三个表连接在一起以获得一个值
- javascript - 如何使用 Ramda.js 在 Javascript 中动态插入二维数组
- linux - Access Parse Dashboard Over Https
- twitter-bootstrap - 如何更改 Bootswatch 主题的颜色?
- arrays - 将整数附加到数组(使用 express 和 pg-promise)
- delphi - 指向另一个过程变量
- c - 从 C 程序到 Gnuplot 的问题管道数据
- c++ - 在永远运行的深度优先搜索代码中找不到错误