最佳答案
我想添加一个全屏图像的视图,所以我写了这个代码
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 访问像素密度,但没有屏幕大小..。
知道吗?