私は1x 2xおよび3xデバイスで表示したい1242 X 450画像を持っています。私が持っている現在のコードは、3xデバイスでうまく動作しますが、イメージのエッジが2xデバイスで切り取られ、1xデバイスでも可能になることがわかります。コードでリアクションネイティブアスペクト比の画像を維持する
(1242 X 450/3Xので)
が、私はそれを修正することができますどのような方法があります私は150に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)をご覧ください。 –