我一直在尝试使用wix react本地导航共享元素过渡动画。但是它不起作用,并且在这方面似乎没有太多帮助。
屏幕2被推入堆栈,但是没有共享元素动画。我已经尝试了几乎所有东西。无效
屏幕1:
<View style={styles.inputContainer}>
<Button
title="SignUp"
style={{...buttonStyle, ...formDimensions.dimensions}}
nativeID={`signUpButton1`}
onPress={() => {
this.signUpButtonHandler();
}}
/>
</View>
signUpButtonHandler = () => {
Navigation.push(this.props.componentId, {
component: {
name: 'mainApp.SignUpScreen',
},
options: {
animations: {
push: {
enabled: true,
sharedElementTransitions: [
{
fromId: `signUpButton1`,
toId: `signUpButtonDest`,
duration: 300
},
],
},
},
},
});
};
屏幕2:
<View style={styles.inputContainer}>
<Button
title="SignUp"
style={{
...buttonStyle,
...formDimensions.dimensions,
...styles.button,
}}
nativeID={`signUpButtonDest`}
onPress={() => {
this.signUpButtonHandler();
}}
/>
您是否尝试过仅使用常规的View
或Image
来查看这些组件是否正常工作?是Button
来自react-native
还是您的自定义组件?