@mpxjs/core 2.10.1-beta.1 → 2.10.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -181,18 +181,29 @@ export default function createApp (options) {
|
|
|
181
181
|
}, [])
|
|
182
182
|
|
|
183
183
|
const { initialRouteName, initialParams } = initialRouteRef.current
|
|
184
|
-
const headerBackImageSource = Mpx.config.rnConfig.headerBackImageSource || null
|
|
185
184
|
const navScreenOpts = {
|
|
186
185
|
// 7.x替换headerBackTitleVisible
|
|
187
186
|
// headerBackButtonDisplayMode: 'minimal',
|
|
188
187
|
headerBackTitleVisible: false,
|
|
189
|
-
// 安卓上会出现初始化时闪现导航条的问题
|
|
190
|
-
headerShown: false,
|
|
191
|
-
// 隐藏导航下的那条线
|
|
192
188
|
headerShadowVisible: false
|
|
193
189
|
}
|
|
194
|
-
if (
|
|
195
|
-
|
|
190
|
+
if (__mpx_mode__ === 'ios') {
|
|
191
|
+
// ios使用native-stack
|
|
192
|
+
const headerBackImageSource = Mpx.config.rnConfig.headerBackImageSource || null
|
|
193
|
+
if (headerBackImageSource) {
|
|
194
|
+
navScreenOpts.headerBackImageSource = headerBackImageSource
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
// 安卓上会出现导航条闪现的问题所以默认加headerShown false(stack版本, native-stack版本可以干掉)
|
|
198
|
+
// iOS加上默认headerShown false的话会因为iOS根高度是screenHeight - useHeaderHeight()会导致出现渲染两次情况,因此iOS不加此默认值
|
|
199
|
+
navScreenOpts.headerShown = false
|
|
200
|
+
// 安卓和鸿蒙先用stack
|
|
201
|
+
const headerBackImageProps = Mpx.config.rnConfig.headerBackImageProps || null
|
|
202
|
+
if (headerBackImageProps) {
|
|
203
|
+
navScreenOpts.headerBackImage = () => {
|
|
204
|
+
return createElement(ReactNative.Image, headerBackImageProps)
|
|
205
|
+
}
|
|
206
|
+
}
|
|
196
207
|
}
|
|
197
208
|
|
|
198
209
|
return createElement(SafeAreaProvider,
|
|
@@ -576,7 +576,7 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
|
|
|
576
576
|
const isCustom = pageConfig.navigationStyle === 'custom'
|
|
577
577
|
navigation.setOptions({
|
|
578
578
|
headerShown: !isCustom,
|
|
579
|
-
title: pageConfig.navigationBarTitleText || '',
|
|
579
|
+
title: pageConfig.navigationBarTitleText?.trim() || '',
|
|
580
580
|
headerStyle: {
|
|
581
581
|
backgroundColor: pageConfig.navigationBarBackgroundColor || '#000000'
|
|
582
582
|
},
|