单击文本时,标题出现错误。
我希望屏幕能够平滑移动而不会被切断或显示白屏。
App.js
import React from "react";
import createAnimatedSwitchNavigator from "react-navigation-animated-switch";
import { Transition } from "react-native-reanimated";
import {
createDrawerNavigator,
createAppContainer,
createStackNavigator
} from "react-navigation";
import A from "./A";
import B from "./B";
const MySwitch = createAnimatedSwitchNavigator(
{
Home: A,
Other: B
},
{
initialRouteName: "Home",
headerMode: "none"
},
{
// The previous screen will slide to the bottom while the next screen will fade in
transition: (
<Transition.Together>
<Transition.Out
type="slide-bottom"
durationMs={400}
interpolation="easeIn"
/>
<Transition.In type="fade" durationMs={500} />
</Transition.Together>
)
}
);
const HomeScreenRouter = createAppContainer(MySwitch);
export default HomeScreenRouter;
A.js
import React from "react";
import { StyleSheet, Text, View, TouchableHighlight } from "react-native";
export default class A extends React.Component {
constructor(props) {
super(props);
this.state = {
loading: false
};
}
render() {
return (
<View style={styles.container}>
<Text onPress={() => this.props.navigation.navigate("Other")}>
Open up App.js to start working on your app!
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center"
}
});
B.js
import React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class B extends React.Component {
constructor(props) {
super(props);
this.state = {
loading: false
};
}
render() {
return (
<View style={styles.container}>
<Text>B screen</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center"
}
});
|反应导航| “ ^ 3.11.0”
|反应本机| “ https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz”
|节点| v10.16.0
|反应本地复活| “ ^ 1.0.1”
|反应导航动画开关| “ ^ 0.2.0”
| npm或纱| 6.9.0
请帮我很多忙
感谢您的帮助。