我想在视图中添加全屏图像,因此我编写了以下代码
return (
<View style={styles.container}>
<Image source={require('image!egg')} style={styles.backgroundImage}/>
</View>
)
并将样式定义为
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
flexDirection: 'column',
},
backgroundImage:{
width:320,
height:480,
}
...
那么这样的话,我应该如何找到实际的iPhone屏幕尺寸呢?
我见过一个可以访问像素密度的API,但是没有关于屏幕尺寸的信息......
有什么想法吗?