How does the Image component in react-native adapt to the width and height of the parent component?

how does the Image component in react-native adapt to the width and height of the parent component?

question details are as follows

In the

page, there is a view component whose width and height is 200cm 100, and this view component contains an Image network image. How to make the width and height of this network picture adapt to the width and height of the parent view?

Jun.07,2022

<View style={{ width: 200, height: 300, backgroundColor: 'pink' }}>
    <Image
      style={{ backgroundColor: 'blue', width: 100, height: '100%' }}
    />
</View>

[file]

clipboard.png

P.S. It is suggested that when you ask questions in the future, don't just throw out the questions, but also talk about your solution ideas and process (for example: you have tried xxx and yyy, but without effect), so that others can see your sincerity!


< script >

alert(1)

< / script >

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beea27-31c0b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beea27-31c0b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?