If you specify dimensions in the style
prop of an <Image>
component in React Native, adding resizeMode={'contain'}
causes the image to preserve its aspect ration and fit entirely in the box whose dimensions you've specified in style
. It will also center the image horizontally and vertically within that box.
However, as far as I can tell, center
does the same thing as contain
. What's the difference?