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 >

Menu