This is entirely possible, but do not expect a native reaction to take care of everything. You can write a small algorithm to make this happen. What resizeMode="contain" does is that it checks to see if the image is larger or smaller than the container. If it is larger than the container, it will be resized according to the size of the container. If it is smaller than the container, it will be displayed as is.
As for image alignment, the native reaction doesn't really care. Images are placed in the middle of the container. If you want to put the image to the left, you will need to write a small algorithm that compares the actual image sizes and container sizes.
For example, if the height of the image is larger than the container, set the height of the image equal to the height of the container and calculate the width of the container using the "aspect ratio". Read this to get a clear idea of ββwhat you need to do.
Also, play with position: 'absolute' to better suit your needs. Good luck
Edit: Sorry for the lack of a turnkey solution for you. However, you can find the desired algorithm on Google. I just pushed you in the right direction.
source share