Weird resize mode in React Native

84 Views Asked by At

) I have a question about the strange scaling of the image in react native, but in the component provided from the package react native gifted chat component: MessageImage. On IOS everything looks fine but on android.. Does anybody have an idea ? thanks for your help in advance! :) Ps. I will just add that the cover looks good on both platforms. enter image description here

 <MessageImage
                            {...props}
                            imageStyle={{
                                width: 148,
                                resizeMode: 'contain',
                                height: 150,
                            }}
                            containerStyle={{
                                backgroundColor: 'transparent',
                                borderColor: 'red',
                                borderWidth: 2,
                            }}
                        />
1

There are 1 best solutions below

0
famfamfam On

better using resizeMode: 'cover', see my snack below to know more: https://snack.expo.dev/@fukemy/image-resize-modes-example?platform=android