我正在使用react native v0.49,我正在尝试在导航到其他页面时实现自定义转换.我要做的是只为场景2到场景3的一个场景进行过渡.但不是所有的应用程序.这个例子我发现它适用于所有网络,所以我想只为一个屏幕和所有应用程序做,因为如果我这样做它将影响所有的应用程序,它不是我正在寻找的.任何的想法?
class SceneOne extends Component {
render() {
return (
<View>
<Text>{'Scene One'}</Text>
</View>
)
}
}
class SceneTwo extends Component {
render() {
return (
<View>
<Text>{'Scene Two'}</Text>
</View>
)
}
}
let AppScenes = {
SceneOne: {
screen: SceneOne
},
SceneTwo: {
screen: SceneTwo
},
SceneThree: {
screen: SceneTwo
},
}
let MyTransition = (index, position) => {
const inputRange = [index - 1, index, index + 1];
const opacity = position.interpolate({
inputRange,
outputRange: [.8, 1, …Run Code Online (Sandbox Code Playgroud)