I have an imageview
that has its height and width set to fill_parent
with a linearlayout
that has the same values set. So I suppose th
use this:
ImageView.setAdjustViewBounds(true);
Give in the xml file of your layout android:scaleType="fitXY"
P.S : this applies to when the image is set with android:src="..."
rather than android:background="..."
as backgrounds are set by default to stretch and fit to the View.
if you use android:scaleType="fitXY"
then you must specify
android:layout_width="75dp"
and android:layout_height="75dp"
if use wrap_content it will not stretch to what you need
<ImageView
android:layout_width="75dp"
android:layout_height="75dp"
android:id="@+id/listItemNoteImage"
android:src="@drawable/MyImage"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_marginStart="12dp"
android:scaleType="fitXY"/>