【发布时间】:2022-01-06 23:29:18
【问题描述】:
这是 SplashScreen.js 页面
我想显示初始屏幕并在超时后不可见,然后导航到入职屏幕(滑动初始屏幕)
import React from 'react';
import { View} from 'react-native';
import LogoImage from './LogoImage.js'
import styles from '../stylesheets/SplashStylesheet.js'
const SplashScreen = ({ navigation }) => {
render() {
let that = this;
setTimeout(function(){that.setState({timePassed: true})}, 1000);
const { navigate } = this.props.navigation;
if (!this.state.timePassed){
return (
<View
style = {styles.splashScreen}>
<LogoImage/>
</View>
);
}
else{
() => navigate('Onboarding);
}
export default SplashScreen;
【问题讨论】:
标签: javascript android reactjs native