我想知道是否有可能调整图片大小使其适合视图。
这是我现在拥有的内容
<View style={styles.container}>
<View style={styles.header}>
<Image
source={headerImage}
/>
</View>
<Text style={styles.basicText}>text</Text>
</View>
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff"
},
header: {
height: 200,
backgroundColor: 'red'
},
background: {
width: null,
height: null
},
image: {
}
我希望将图像适应于页眉视图。
resizeMode
,详情请参考http://facebook.github.io/react-native/releases/0.45/docs/image.html - Jigar Shah