提交 4b904170 编写于 作者: Q qiang

fix(App): 修复 backgroundColor、navigationBarBackgroundColor 设置为不支持的值时 iOS 设备显示为透明的问题

上级 d5d2139a
...@@ -54,12 +54,13 @@ export function parseTitleNView (routeOptions) { ...@@ -54,12 +54,13 @@ export function parseTitleNView (routeOptions) {
always: 'float' always: 'float'
} }
const navigationBarBackgroundColor = windowOptions.navigationBarBackgroundColor
const ret = { const ret = {
autoBackButton: !routeOptions.meta.isQuit, autoBackButton: !routeOptions.meta.isQuit,
titleText: titleImage === '' ? windowOptions.navigationBarTitleText || '' : '', titleText: titleImage === '' ? windowOptions.navigationBarTitleText || '' : '',
titleColor: windowOptions.navigationBarTextStyle === 'black' ? '#000000' : '#ffffff', titleColor: windowOptions.navigationBarTextStyle === 'black' ? '#000000' : '#ffffff',
type: titleNViewTypeList[transparentTitle], type: titleNViewTypeList[transparentTitle],
backgroundColor: windowOptions.navigationBarBackgroundColor || '#f8f8f8', backgroundColor: (/^#[a-z0-9]{6}$/i.test(navigationBarBackgroundColor) || navigationBarBackgroundColor === 'transparent') ? navigationBarBackgroundColor : '#f7f7f7',
tags: titleImage === '' ? [] : [{ tags: titleImage === '' ? [] : [{
tag: 'img', tag: 'img',
src: titleImage, src: titleImage,
......
...@@ -45,7 +45,7 @@ export function parseWebviewStyle (id, path, routeOptions = {}) { ...@@ -45,7 +45,7 @@ export function parseWebviewStyle (id, path, routeOptions = {}) {
}) })
const backgroundColor = routeOptions.window.backgroundColor const backgroundColor = routeOptions.window.backgroundColor
if (backgroundColor) { if (/^#[a-z0-9]{6}$/i.test(backgroundColor) || backgroundColor === 'transparent') {
if (!webviewStyle.background) { if (!webviewStyle.background) {
webviewStyle.background = backgroundColor webviewStyle.background = backgroundColor
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册