Skip to content

Commit

Permalink
fix(rn-runtime): 修复页面与全局设置backgroundColor不生效问题 #8708
Browse files Browse the repository at this point in the history
  • Loading branch information
yechunxi authored and zhiqingchen committed Mar 1, 2021
1 parent e927069 commit 7e762f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/taro-runtime-rn/src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,14 @@ export function createPageConfig (Page: any, pageConfig: PageConfig): any {
}

createScrollPage () {
let bgColor = pageConfig.backgroundColor ? pageConfig.backgroundColor : ''
const windowOptions = globalAny.__taroAppConfig?.appConfig?.window || {}
if (!bgColor && windowOptions?.backgroundColor) {
bgColor = windowOptions?.backgroundColor
}
const refresh = this.isEnablePullDown() ? { refreshControl: this.refreshPullDown() } : {}
return h(ScrollView, {
style: { flex: 1 },
style: [{ flex: 1 }, (bgColor ? { backgroundColor: bgColor } : {})],
contentContainerStyle: { minHeight: '100%' },
ref: this.pageScrollView,
scrollEventThrottle: 8,
Expand Down

0 comments on commit 7e762f8

Please sign in to comment.