Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

页面切换没有动画 #43

Open
hyfjjjj opened this issue Dec 5, 2024 · 0 comments
Open

页面切换没有动画 #43

hyfjjjj opened this issue Dec 5, 2024 · 0 comments

Comments

@hyfjjjj
Copy link

hyfjjjj commented Dec 5, 2024

Question

用rn的鸿蒙开发新手,发现使用此库时页面切换没有动画,是需要配置什么特殊的参数(已经设置了animation)或者有些其他的依赖库没有装导致的?或者是在鸿蒙项目端非rn端需要配置什么东西?或者模拟器上有bug需要真机测试?

代码如下:

import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Platform } from 'react-native';
import WebPage from 'xxx'
const Stack = createNativeStackNavigator();

<Stack.Navigator
  screenOptions={{
    animation: 'slide_from_right', // 这块尝试换过 'default', 'simple_push' 等各种均没有动画
  }}
>
  <Stack.Screen
    name="web"
    component={WebPage as any}
    options={({ navigation }) => ({
      title: '',
    })}
  />
</Stack.Navigator>

在其他页面通过 navigation.navigate('web', { url: 'https://www.baidu.com' }); 打开web页面时,完全没有动画,直接闪出web页面,关闭也没有动画。请教一下究竟需要怎么修改。

已经安装的相关的库,并且鸿蒙测已经全部配置完成:

"@react-native-oh-tpl/elements": "^1.3.21-0.1.4",
"@react-native-oh-tpl/native-stack": "^6.9.26-0.0.2",
"@react-native-oh-tpl/react-native-device-info": "^11.1.0-0.0.3",
"@react-native-oh-tpl/react-native-gesture-handler": "^2.14.1-2.14.15",
"@react-native-oh-tpl/react-native-safe-area-context": "^4.7.4-0.2.0",
"@react-native-oh-tpl/stack": "^6.4.0-0.0.4", // 这个是后来测试安装的

当使用 @react-native-oh-tpl/stack 时动画正常。当使用 @react-navigation/native-stack 时完全没有任何动画。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant