不知道为啥 页面没有占满屏幕 上面多出很大一部分空白来
import React from 'react';
import { View, Text, TouchableOpacity, Image, StyleSheet } from 'react-native';
import { StackActions, NavigationActions } from 'react-navigation';
import HomePage from './HomePage';
import NavigationBar from '../commons/navigationBar';
//import clear from 'react-native-clear-app-cache';
export default class Welcome extends React.Component {
constructor(props) {
super(props)
}
componentWillMount() {
// clear.clearAppCache(() => {
// alert("清理缓存成功")
// })
}
componentDidMount() {
// this.timer = setTimeout(() => {
// const resetAction = StackActions.reset({
// index: 0,
// actions: [NavigationActions.navigate({ routeName: 'HomePage' })],
// });
// this.props.navigation.dispatch(resetAction);
// },2000)
}
componentWillUnmount() {
//this.timer && clearTimeout(this.timer)
}
render() {
return (
<View style={styles.container}>
<Text>欢迎页</Text>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'pink',
}
})
路由配置文件里,加入
,因为空白部分是导航header导致的