简体   繁体   English

在没有动画的情况下反应原生Android过渡

[英]React Native Android transition without animaiton

How do I transition between scenes without animations using Navigator? 如何使用导航器在没有动画的场景之间切换?

When I do a Navigator.replace(), the view just switches instantly, I'd like to replicate this behavior with a Navigator.push() call. 当我执行Navigator.replace()时,视图会立即切换,我想通过Navigator.push()调用来复制此行为。

I've been playing around with SceneConfigs and feel like that might be the right solution, but can't get it to work. 我一直在使用SceneConfigs,感觉那可能是正确的解决方案,但无法使其正常工作。

I found a hacky solution here. 我在这里找到了一个骇人听闻的解决方案。 https://github.com/facebook/react-native/issues/1953 https://github.com/facebook/react-native/issues/1953

var NoTransition = { opacity: { from: 1, to: 1, min: 1, max: 1, type: 'linear', extrapolate: false, round: 100, }, }; var NoTransition = {opacity:{from:1,to:1,min:1,max:1,type:'linear',外推:false,round:100,},};

return  {
            ...Navigator.SceneConfigs.FloatFromLeft,
            gestures: null,
            defaultTransitionVelocity: 100,
            animationInterpolators: {
              into: buildStyleInterpolator(NoTransition),
              out: buildStyleInterpolator(NoTransition),
            },
        };

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native中视图之间的过渡而无需维护堆栈 - Transition between Views in React Native without maintaining a Stack 没有 Android Studio 的 React Native? - React Native without Android Studio? Android Geofence Transition PendingIntent似乎未运行(反应本机桥) - Android Geofence Transition PendingIntent seems not to run (react-native bridge) React Native Android构建失败无一例外 - React Native android build fails without an exception React Native Android zIndex 高度无需重新排列 - React Native Android zIndex elevation without rearranging React Navigation:Android 的 StackNavigator 转换 - React Navigation: StackNavigator transition for Android 在 Windows 10 上没有 android studio 环境的 React Native - React Native without android studio environement on windows 10 是否可以在不运行模拟器的情况下为Android构建React本机应用程序? - Is it possible to build a react native application for Android without running an emulator? 如何获取TextInput值而不使用反应原生android中的状态 - how to get TextInput value without using state in react native android 如何在没有代码的情况下在 Android 上查看 React Native App 的网络流量 - How to view network traffic of React Native App on Android WITHOUT code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM