diff --git a/en/react-navigation-native-stack.md b/en/react-navigation-native-stack.md index 847a9b637a022eeaf6e6a9f6525a1ca0cdb6e2fb..f605d753dafd82b85c33e95e9ec5d0af0c1a2fc5 100644 --- a/en/react-navigation-native-stack.md +++ b/en/react-navigation-native-stack.md @@ -18,7 +18,7 @@ The repository for this third-party library has been migrated to Gitcode, and it | Version | Package Name | Repository | Release | Version for RN | | ------------------------------ | ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------- | -| 6.9.26 | @react-native-oh-tpl/native-stack | [Github](https://github.com/react-native-oh-library/react-navigation/tree/sig/packages/native-stack) | [Github Releases](https://github.com/react-native-oh-library/react-navigation/releases) | 0.72 | +| 6.9.27 | @react-native-ohos/native-stack | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-navigation/tree/br_rnoh0.72/packages/native-stack) | [GitCode Releases]() | 0.72 | | 7.3.11 | @react-native-ohos/native-stack | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-navigation/tree/br_rnoh0.77/packages/native-stack) | [GitCode Releases]() | 0.77 | For older versions that have not been released to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package @@ -33,7 +33,7 @@ Go to the project directory and execute the following instruction: ```bash # for RN0.72 -npm install @react-native-oh-tpl/native-stack +npm install @react-native-ohos/native-stack # for RN0.77 npm install @react-native-ohos/native-stack @@ -43,7 +43,7 @@ npm install @react-native-ohos/native-stack ```bash # for RN0.72 -yarn install @react-native-oh-tpl/native-stack +yarn install @react-native-ohos/native-stack # for RN0.77 yarn install @react-native-ohos/native-stack @@ -211,12 +211,12 @@ The following attributes have been verified. For more details on the attributes, | fullScreenGestureEnabled | Whether the gesture to dismiss should work on the whole screen. Using gesture to dismiss with this option results in the same transition animation as simple_push. This behavior can be changed by setting customAnimationOnGesture prop. Achieving the default iOS animation isn't possible due to platform limitations. Defaults to false. | boolean | no | iOS | no | | gestureEnabled | Whether you can use gestures to dismiss this screen. Defaults to true. | boolean | no | iOS | no | | animationTypeForReplace | The type of animation to use when this screen replaces another screen. Defaults to pop. | 'push'|'pop' | no | Android,iOS | no | -| animation | How the screen should animate when pushed or popped. | 'default'|'fade'|'fade_from_bottom'|'fade_from_bottom'|'simple_push'|'slide_from_bottom'|'slide_from_right'|'slide_from_left'|'none' | no | Android,iOS | no | +| animation | How the screen should animate when pushed or popped. | 'default'|'fade'|'fade_from_bottom'\|'simple_push'|'slide_from_bottom'|'slide_from_right'|'slide_from_left'|'ios_from_right'\|'ios_from_left'\|'none' | no | Android,iOS | yes | | presentation | How should the screen be presented. | 'card'|'modal'|'transparentModal'|'containedModal'|'containedModal'|'fullScreenModal'|'formSheet' | no | Android,iOS | partially('card'/'transparentModal') | | orientation | The display orientation to use for the screen. | 'default'|'all'|'portrait'|'portrait_up'|'portrait_down'|'landscape'|'landscape_left'|'landscape_left' | no | Android,iOS | no | | autoHideHomeIndicator | Boolean indicating whether the home indicator should prefer to stay hidden. Defaults to false. | boolean | no | iOS | no | | gestureDirection | Sets the direction in which you should swipe to dismiss the screen. | 'vertical '|'horizontal ' | no | iOS | no | -| animationDuration | Changes the duration (in milliseconds) of slide_from_bottom, fade_from_bottom, fade and simple_push transitions on iOS. Defaults to 350. | number | no | iOS | no | +| animationDuration | Changes the duration (in milliseconds) of slide_from_bottom, fade_from_bottom, fade and simple_push transitions on iOS. Defaults to 350. | number | no | iOSyes | | | navigationBarColor | Sets the navigation bar color. Defaults to initial status bar color. | string | no | Android | no | | navigationBarHidden | Boolean indicating whether the navigation bar should be hidden. Defaults to false. | boolean | no | Android | no | | freezeOnBlur | Boolean indicating whether to prevent inactive screens from re-rendering. Defaults to false. Defaults to true when enableFreeze() from react-native-screens package is run at the top of the application. | boolean | no | Android,iOS | no | diff --git a/zh-cn/react-navigation-native-stack.md b/zh-cn/react-navigation-native-stack.md index 5928ecef374ff440fdbe2d75602184f865862b8b..47ffbd1f13f9bfebb70c442bde46f47deebd6feb 100644 --- a/zh-cn/react-navigation-native-stack.md +++ b/zh-cn/react-navigation-native-stack.md @@ -18,8 +18,8 @@ | Version | Package Name | Repository | Release | Version for RN | | ------------------------------ | ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------- | -| 6.9.26 | @react-native-oh-tpl/native-stack | [Github](https://github.com/react-native-oh-library/react-navigation/tree/sig/packages/native-stack) | [Github Releases](https://github.com/react-native-oh-library/react-navigation/releases) | 0.72 | -| 7.3.11 | @react-native-ohos/native-stack | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-navigation/tree/br_rnoh0.77/packages/native-stack) | [GitCode Releases]() | 0.77 | +| 6.9.27 | @react-native-ohos/native-stack | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-navigation/tree/br_rnoh0.72/packages/native-stack) | [GitCode Releases]() | 0.72 | +| 7.3.12 | @react-native-ohos/native-stack | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-navigation/tree/br_rnoh0.77/packages/native-stack) | [GitCode Releases]() | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -33,7 +33,7 @@ ```bash # for RN0.72 -npm install @react-native-oh-tpl/native-stack +npm install @react-native-ohos/native-stack # for RN0.77 npm install @react-native-ohos/native-stack @@ -43,7 +43,7 @@ npm install @react-native-ohos/native-stack ```bash # for RN0.72 -yarn install @react-native-oh-tpl/native-stack +yarn install @react-native-ohos/native-stack # for RN0.77 yarn install @react-native-ohos/native-stack @@ -176,59 +176,59 @@ export default function App() { **Options & screenOptions** -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| ----------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ------------ | ----------------- | -| title | 可用作headerTitle回退的字符串. | string | no | all | yes | -| headerBackButtonMenuEnabled | 布尔值,指示在长按 iOS 14 及以上版本的返回按钮时是否显示菜单,默认为 true | boolean | no | iOS | no | -| headerBackVisible | 返回按钮在标题栏中是否可见。如果已指定 headerLeft,可以使用此属性在 headerLeft 旁边显示返回按钮. | boolean | no | Android,iOS | no | -| headerBackTitle | iOS 上返回按钮使用的标题字符串。默认为上一个场景的标题,如果空间不足则为 "Back"。使用 headerBackTitleVisible: false 可隐藏. | string | no | iOS | no | -| headerBackTitleStyle | 标题栏返回标题的样式对象. | object | no | iOS | no | -| headerBackImageSource | 在标题栏中显示为返回按钮图标的图像. | string | no | all | yes | -| headerLargeStyle | 显示大标题时的标题栏样式. | object | no | iOS | no | -| headerLargeTitle | 是否启用大标题,滚动时折叠为常规标题. | string | no | iOS | no | -| headerLargeTitleShadowVisible | 显示大标题时标题栏的投影是否可见. | boolean | no | iOS | no | -| headerLargeTitleStyle | 标题栏中大标题的样式对象. | object | no | iOS | no | -| headerShown | 是否显示标题栏。默认显示标题栏。设置为 false 可隐藏标题栏. | boolean | no | all | yes | -| headerStyle | 标题栏的样式对象. | object | no | all | yes | -| headerShadowVisible | 是否隐藏标题上的标高阴影 (Android) 或底部边框 (iOS)。 | object | no | Android,iOS | yes | -| headerTransparent | 指示导航栏是否半透明的布尔值. | boolean | no | all | yes | -| headerBlurEffect | 半透明标题的模糊效果。 headerTransparent 选项需要设置为 true 才能正常工作. | string | no | iOS | no | -| headerBackground | 返回一个 React 元素以呈现为标题背景的函数。这对于使用图像或渐变等背景非常有用. | function | no | all | yes | -| headerTintColor | 标题的色调颜色。更改后退按钮和标题的颜色. | string | no | all | yes | -| headerLeft | 返回一个 React 元素以显示在标题左侧的函数。这取代了后退按钮。请参阅 headerBackVisible 以显示左侧元素的后退按钮. | function | no | all | yes | -| headerRight | 返回一个 React 元素以显示在标题右侧的函数. | function | no | all | yes | -| headerTitle | 字符串或返回要由标头使用的 React 元素的函数。默认为屏幕的标题或名称. | string|function | no | all | yes | -| headerTitleAlign | 如何对齐标题标题。在 iOS 以外的平台上默认为左对齐。iOS 不支持。它始终以 iOS 为中心,无法更改. | 'left'|'right' | no | Android | yes | -| headerTitleStyle | 标题的样式对象. | object | no | all | yes | -| headerSearchBarOptions | 在 iOS 上呈现本机搜索栏的选项. | object | no | Android,iOS | no | -| header | 使用自定义标头代替默认标头. | function | no | all | no | -| statusBarAnimation | 设置状态栏动画(类似于 StatusBar 组件)。默认在 iOS 上淡入淡出,在 Android 上不淡入淡出. | 'fade'|'none'|'slide' | no | Android,iOS | no | -| statusBarHidden | 状态栏是否应在此屏幕上隐藏. | boolean | no | Android,iOS | no | -| statusBarStyle | 设置状态栏颜色(类似于 StatusBar 组件)。默认为自动. | string | no | Android,iOS | no | -| statusBarColor | 设置状态栏颜色(类似于 StatusBar 组件)。默认为初始状态栏颜色。 | string | no | Android | no | -| statusBarTranslucent | 设置状态栏的半透明度(类似于StatusBar组件)。默认为 false. | boolean | no | Android | no | -| contentStyle | 场景内容的样式对象. | object | no | all | yes | -| customAnimationOnGesturedeprecated from 7.3.10 > | 关闭手势是否应使用提供给动画道具的动画。默认为 false | boolean | no | iOS | no | -| fullScreenGestureEnabled | 关闭手势是否适用于整个屏幕。使用手势来关闭此选项会产生与 simple_push 相同的过渡动画。可以通过设置 customAnimationOnGesture 属性来更改此行为。由于平台限制,无法实现默认的 iOS 动画。默认为 false。 | boolean | no | iOS | no | -| gestureEnabled | 是否可以使用手势关闭此屏幕。默认为 true。 | boolean | no | iOS | no | -| animationTypeForReplace | 当此屏幕替换另一个屏幕时要使用的动画类型。默认为弹出。 | 'push'|'pop' | no | Android,iOS | no | -| animation | 按下或弹出时屏幕应如何呈现动画。 | 'default'|'fade'|'fade_from_bottom'|'fade_from_bottom'|'simple_push'|'slide_from_bottom'|'slide_from_right'|'slide_from_left'|'none' | no | Android,iOS | no | -| presentation | 画面应该如何呈现。 | 'card'|'modal'|'transparentModal'|'containedModal'|'containedModal'|'fullScreenModal'|'formSheet' | no | Android,iOS | partially('card'/'transparentModal') | -| orientation | 屏幕使用的显示方向。 | 'default'|'all'|'portrait'|'portrait_up'|'portrait_down'|'landscape'|'landscape_left'|'landscape_left' | no | Android,iOS | no | -| autoHideHomeIndicator | 指示主页指示器是否应该保持隐藏的布尔值。默认为 false。 | boolean | no | iOS | no | -| gestureDirection | 设置滑动以关闭屏幕的方向。 | 'vertical '|'horizontal ' | no | iOS | no | -| animationDuration | 更改 iOS 上的 slip_from_bottom、fade_from_bottom、fade 和 simple_push 过渡的持续时间(以毫秒为单位)。默认为 350。 | number | no | iOS | no | -| navigationBarColor | 设置导航栏颜色。默认为初始状态栏颜色。 | string | no | Android | no | -| navigationBarHidden | 指示是否应隐藏导航栏的布尔值。默认为 false。 | boolean | no | Android | no | -| freezeOnBlur | 布尔值,指示是否阻止非活动屏幕重新渲染。默认为 false。当react-native-screens包中的enableFreeze()在应用程序顶部运行时,默认为true。 | boolean | no | Android,iOS | no | -| headerBackButtonDisplayMode7.3.10+ | 后退按钮如何显示图标和标题。 | 'default' \| 'generic' \| 'minimal ' | no | iOS | yes | -| animationMatchesGesture7.3.10+ | 要解除的手势是否应使用提供给动画道具的动画。默认为false。不会影响以模式呈现的屏幕的行为。 | boolean | no | iOS | no | -| sheetElevation7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
描述底部工作表阴影高度的整数值,影响底部工作表的阴影高度 | number | no | Android | no | -| sheetExpandsWhenScrolledToEdge7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
控制工作表在滚动时是否应展开到更大的悬停位置。 | boolean | no | iOS | no | -| sheetCornerRadius7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
工作表尝试渲染时使用的圆角半径。 | number | no | Android,iOS | no | -| sheetInitialDetentIndex7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
工作表打开后应展开到的悬停位置的索引。 | number | no | Android,iOS | no | -| sheetGrabberVisible7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
布尔值,指示工作表顶部是否显示抓取器。 | boolean | no | iOS | no | -| sheetLargestUndimmedDetentIndex7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
工作表下方视图不会被调暗的最大悬停位置索引。 | 'none' \| 'last' | no | Android,iOS | no | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| ----------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ------------ | ------------------------------------ | +| title | 可用作headerTitle回退的字符串. | string | no | all | yes | +| headerBackButtonMenuEnabled | 布尔值,指示在长按 iOS 14 及以上版本的返回按钮时是否显示菜单,默认为 true | boolean | no | iOS | no | +| headerBackVisible | 返回按钮在标题栏中是否可见。如果已指定 headerLeft,可以使用此属性在 headerLeft 旁边显示返回按钮. | boolean | no | Android,iOS | no | +| headerBackTitle | iOS 上返回按钮使用的标题字符串。默认为上一个场景的标题,如果空间不足则为 "Back"。使用 headerBackTitleVisible: false 可隐藏. | string | no | iOS | no | +| headerBackTitleStyle | 标题栏返回标题的样式对象. | object | no | iOS | no | +| headerBackImageSource | 在标题栏中显示为返回按钮图标的图像. | string | no | all | yes | +| headerLargeStyle | 显示大标题时的标题栏样式. | object | no | iOS | no | +| headerLargeTitle | 是否启用大标题,滚动时折叠为常规标题. | string | no | iOS | no | +| headerLargeTitleShadowVisible | 显示大标题时标题栏的投影是否可见. | boolean | no | iOS | no | +| headerLargeTitleStyle | 标题栏中大标题的样式对象. | object | no | iOS | no | +| headerShown | 是否显示标题栏。默认显示标题栏。设置为 false 可隐藏标题栏. | boolean | no | all | yes | +| headerStyle | 标题栏的样式对象. | object | no | all | yes | +| headerShadowVisible | 是否隐藏标题上的标高阴影 (Android) 或底部边框 (iOS)。 | object | no | Android,iOS | yes | +| headerTransparent | 指示导航栏是否半透明的布尔值. | boolean | no | all | yes | +| headerBlurEffect | 半透明标题的模糊效果。 headerTransparent 选项需要设置为 true 才能正常工作. | string | no | iOS | no | +| headerBackground | 返回一个 React 元素以呈现为标题背景的函数。这对于使用图像或渐变等背景非常有用. | function | no | all | yes | +| headerTintColor | 标题的色调颜色。更改后退按钮和标题的颜色. | string | no | all | yes | +| headerLeft | 返回一个 React 元素以显示在标题左侧的函数。这取代了后退按钮。请参阅 headerBackVisible 以显示左侧元素的后退按钮. | function | no | all | yes | +| headerRight | 返回一个 React 元素以显示在标题右侧的函数. | function | no | all | yes | +| headerTitle | 字符串或返回要由标头使用的 React 元素的函数。默认为屏幕的标题或名称. | string|function | no | all | yes | +| headerTitleAlign | 如何对齐标题标题。在 iOS 以外的平台上默认为左对齐。iOS 不支持。它始终以 iOS 为中心,无法更改. | 'left'|'right' | no | Android | yes | +| headerTitleStyle | 标题的样式对象. | object | no | all | yes | +| headerSearchBarOptions | 在 iOS 上呈现本机搜索栏的选项. | object | no | Android,iOS | no | +| header | 使用自定义标头代替默认标头. | function | no | all | no | +| statusBarAnimation | 设置状态栏动画(类似于 StatusBar 组件)。默认在 iOS 上淡入淡出,在 Android 上不淡入淡出. | 'fade'|'none'|'slide' | no | Android,iOS | no | +| statusBarHidden | 状态栏是否应在此屏幕上隐藏. | boolean | no | Android,iOS | no | +| statusBarStyle | 设置状态栏颜色(类似于 StatusBar 组件)。默认为自动. | string | no | Android,iOS | no | +| statusBarColor | 设置状态栏颜色(类似于 StatusBar 组件)。默认为初始状态栏颜色。 | string | no | Android | no | +| statusBarTranslucent | 设置状态栏的半透明度(类似于StatusBar组件)。默认为 false. | boolean | no | Android | no | +| contentStyle | 场景内容的样式对象. | object | no | all | yes | +| customAnimationOnGesturedeprecated from 7.3.10 > | 关闭手势是否应使用提供给动画道具的动画。默认为 false | boolean | no | iOS | no | +| fullScreenGestureEnabled | 关闭手势是否适用于整个屏幕。使用手势来关闭此选项会产生与 simple_push 相同的过渡动画。可以通过设置 customAnimationOnGesture 属性来更改此行为。由于平台限制,无法实现默认的 iOS 动画。默认为 false。 | boolean | no | iOS | no | +| gestureEnabled | 是否可以使用手势关闭此屏幕。默认为 true。 | boolean | no | iOS | no | +| animationTypeForReplace | 当此屏幕替换另一个屏幕时要使用的动画类型。默认为弹出。 | 'push'|'pop' | no | Android,iOS | no | +| animation | 按下或弹出时屏幕应如何呈现动画。 | 'default'|'fade'|'fade_from_bottom'\|'simple_push'|'slide_from_bottom'|'slide_from_right'|'slide_from_left'|'ios_from_right'\|'ios_from_left'\|'none' | no | Android,iOS | yes | +| presentation | 画面应该如何呈现。 | 'card'|'modal'|'transparentModal'|'containedModal'|'containedModal'|'fullScreenModal'|'formSheet' | no | Android,iOS | partially('card'/'transparentModal') | +| orientation | 屏幕使用的显示方向。 | 'default'|'all'|'portrait'|'portrait_up'|'portrait_down'|'landscape'|'landscape_left'|'landscape_left' | no | Android,iOS | no | +| autoHideHomeIndicator | 指示主页指示器是否应该保持隐藏的布尔值。默认为 false。 | boolean | no | iOS | no | +| gestureDirection | 设置滑动以关闭屏幕的方向。 | 'vertical '|'horizontal ' | no | iOS | no | +| animationDuration | 更改 iOS 上的 slide_from_bottom、fade_from_bottom、fade 和 simple_push 过渡的持续时间(以毫秒为单位)。默认为 350。 | number | no | iOS | yes | +| navigationBarColor | 设置导航栏颜色。默认为初始状态栏颜色。 | string | no | Android | no | +| navigationBarHidden | 指示是否应隐藏导航栏的布尔值。默认为 false。 | boolean | no | Android | no | +| freezeOnBlur | 布尔值,指示是否阻止非活动屏幕重新渲染。默认为 false。当react-native-screens包中的enableFreeze()在应用程序顶部运行时,默认为true。 | boolean | no | Android,iOS | no | +| headerBackButtonDisplayMode7.3.10+ | 后退按钮如何显示图标和标题。 | 'default' \| 'generic' \| 'minimal ' | no | iOS | yes | +| animationMatchesGesture7.3.10+ | 要解除的手势是否应使用提供给动画道具的动画。默认为false。不会影响以模式呈现的屏幕的行为。 | boolean | no | iOS | no | +| sheetElevation7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
描述底部工作表阴影高度的整数值,影响底部工作表的阴影高度 | number | no | Android | no | +| sheetExpandsWhenScrolledToEdge7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
控制工作表在滚动时是否应展开到更大的悬停位置。 | boolean | no | iOS | no | +| sheetCornerRadius7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
工作表尝试渲染时使用的圆角半径。 | number | no | Android,iOS | no | +| sheetInitialDetentIndex7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
工作表打开后应展开到的悬停位置的索引。 | number | no | Android,iOS | no | +| sheetGrabberVisible7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
布尔值,指示工作表顶部是否显示抓取器。 | boolean | no | iOS | no | +| sheetLargestUndimmedDetentIndex7.3.10+ | 仅当演示文稿设置为formSheet时才有效。
工作表下方视图不会被调暗的最大悬停位置索引。 | 'none' \| 'last' | no | Android,iOS | no | **Events**