From 8ab4e76fddb6d206de0bef43e9d4bf3f82a0d5d0 Mon Sep 17 00:00:00 2001 From: human Date: Wed, 15 Jan 2025 22:28:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8native-stack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rnIntersectionObserver.js | 2 +- packages/core/src/platform/createApp.ios.js | 1 - .../core/src/platform/patch/getDefaultOptions.ios.js | 9 ++------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js b/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js index b9d423e3f4..f8ce5fed91 100644 --- a/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js +++ b/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js @@ -90,7 +90,7 @@ class RNIntersectionObserver { if (this.windowRect) return this.windowRect const navigation = getFocusedNavigation() || {} const screen = Dimensions.get('screen') - const navigationLayout = navigation.layout || { + const navigationLayout = navigation.layout || { x: 0, y: 0, width: screen.width, diff --git a/packages/core/src/platform/createApp.ios.js b/packages/core/src/platform/createApp.ios.js index 9e41b822c6..2c2c6cf7b9 100644 --- a/packages/core/src/platform/createApp.ios.js +++ b/packages/core/src/platform/createApp.ios.js @@ -6,7 +6,6 @@ import { LIFECYCLE } from '../platform/patch/lifecycle/index' import Mpx from '../index' import { createElement, memo, useRef, useEffect } from 'react' import * as ReactNative from 'react-native' -import { Image } from 'react-native' const appHooksMap = makeMap(mergeLifecycle(LIFECYCLE).app) diff --git a/packages/core/src/platform/patch/getDefaultOptions.ios.js b/packages/core/src/platform/patch/getDefaultOptions.ios.js index c98e3ea19b..71bcbdeb75 100644 --- a/packages/core/src/platform/patch/getDefaultOptions.ios.js +++ b/packages/core/src/platform/patch/getDefaultOptions.ios.js @@ -505,14 +505,9 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) { headerStyle: { backgroundColor: pageConfig.navigationBarBackgroundColor || '#000000' }, - headerTintColor: pageConfig.navigationBarTextStyle || 'white' + headerTintColor: pageConfig.navigationBarTextStyle || 'white', + statusBarTranslucent: true }) - if (__mpx_mode__ === 'android') { - ReactNative.StatusBar.setBarStyle(pageConfig.barStyle || 'dark-content') - ReactNative.StatusBar.setTranslucent(isCustom) // 控制statusbar是否占位 - const color = isCustom ? 'transparent' : pageConfig.statusBarColor - color && ReactNative.StatusBar.setBackgroundColor(color) - } }, []) const rootRef = useRef(null)