From 7e762f8f71ad4b2b39322df07ce284a4f6fba8fa Mon Sep 17 00:00:00 2001 From: yechunxi Date: Mon, 22 Feb 2021 15:40:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(rn-runtime):=20=E4=BF=AE=E5=A4=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=B8=8E=E5=85=A8=E5=B1=80=E8=AE=BE=E7=BD=AEbackgroun?= =?UTF-8?q?dColor=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98=20#8708?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-runtime-rn/src/page.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/taro-runtime-rn/src/page.ts b/packages/taro-runtime-rn/src/page.ts index 6954955484a6..64710ccf5ab6 100644 --- a/packages/taro-runtime-rn/src/page.ts +++ b/packages/taro-runtime-rn/src/page.ts @@ -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,