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

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

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