[英]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.