当我运行React Native项目时,我的背景颜色占据了照片中一半的屏幕,而在移动版(android)中,只有状态栏出现在屏幕上。我该如何解决?
台式机
移动
项目代码
(routes.js)
import React, { Component } from 'react';
import {Router, Stack, Scene} from 'react-native-router-flux';
import Login from './pages/Login';
import Signup from './pages/Signup';
export default class Routes extends Component {
render () {
return (
<Router sceneStyle={{backgroundColor: '#81b71a'}}>
<Stack key="root">
<Scene key="login" component={Login} title="Giriş Yap" initial={true}/>
<Scene key="signup" component={Signup} title="Kayıt Ol" />
</Stack>
</Router>
)
}
}
(app.js)
import React, { Component } from 'react';
import { Dimensions, StyleSheet, View } from 'react-native';
import ActiveStatus from './src/components/StatusBar';
import Routes from './src/Routes';
export default class App extends Component {
render () {
return (
<View style={styles.container}>
<ActiveStatus />
<Routes />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
},
});