1x 2x 및 3x 장치에 표시하려는 1242x450 이미지가 있습니다. 현재 가지고있는 코드는 3x 장치에서 잘 작동하지만 이미지의 가장자리가 2x 장치에서 잘리고 1x 장치에서도 가능하다는 것을 알았습니다. 코드에서React Native 종횡비 이미지 유지 ios
나는
내가 그것을 고칠 수있는 방법이 있나요 (150) (X 450/배 1242 때문에) 414에 폭과 높이를 설정입니까?
이미지는 목록보기 당신은 이미지의 크기를 처리 할 필요가 없습니다
<View style={styles.row}>
<Image
style={styles.featureImage}
source={{
uri: this.props.image_src
}}/>
</View>
const styles = StyleSheet.create({
row: {
alignItems: 'center',
backgroundColor: 'lightgrey',
flexDirection: 'row',
margin: 6,
},
featureImage: {
height: 150,
width: 414
}
});
[react-native-scalable-image] (https://www.npmjs.com/package/react-native-scalable-image)를보십시오. –