April 20, 2021

Software Mile.com

Latest Software News and Hacks

Image height is stretched in IOS for Ionic 5 app

Image height is stretched in IOS for Ionic 5 app

In my Ionic 5 app, I am facing a problem with image size for IOS. I am simply displaying an image on an ion-card. The potrait images are fine but not the landscaps.

HTML:

<ion-card>
<ion-row class="ion-justify-content-start">
<img [src]=path alt=""/>
</ion-row>
</ion-card>

SCSS:

img {
    max-height: 70vw;
    border-radius: 10px !important;
}

The expected result is the following. The browser and android is showing the correct size.
Image height is stretched in IOS for Ionic 5 app

Following is the IOS image. The height is stretched out.
enter image description here


Go to Source of this post
Author Of this post: Tapas Mukherjee
Title Of post: Image height is stretched in IOS for Ionic 5 app
Author Link: {authorlink}