I am trying to scale an image specifying only the width I want. The height would be scaled in a way that the aspect ratio is preserved. The image I am using is big enough to cover the whole screen. The code I am trying looks like this:
<ImageView android:src="@drawable/logo"
android:layout_width="100sp" android:id="@+id/imageView1"
android:layout_height="wrap_content" android:scaleType="centerInside"/>
If I use "fitXY" the image doesnt preserve the aspect ratio and when I use "centerInside" the image is not scaled.. Any idea?
Thank you in advance.