There are many questions about resizing ImageView and while keeping aspect ratio, but I'm not able to manage to resize my ImageView. Is really even Android's ImageView so badly designed, that we can't resize it while keeping aspect ratio. This is my code which doesn't work (I set):
<ImageView
android:id="@+id/icon"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="@drawable/sample"/>
My Image is png with approx 200 x 300 px size (the size is varying). I want the ImageView to resize it to 30 dp width, while keeping aspect ratio. FYI: I can't set ImageView's parent dimensions, the parent's dimension are match_parent.