I have a really simple image within a RelativeLayout
and for some reason I am getting extra spacing on the top and bottom which I can\'t remove. How can I clear
If your image view height is match_parent, even if you set android:adjustViewBounds="true" ImageView will add some extra blank space at top and bottom side. so, change ImageView height to wrap_content and set android:adjustViewBounds="true"
for example
<ImageView
android:id="@+id/img_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"/>
Try this
<ImageView
(...)
android:adjustViewBounds="true" />
android:scaleType="centerCrop" by adding this
<ImageView
android:id="@+id/image"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/temp_image"
android:adjustViewBounds="true"
android:scaleType="centerCrop"/>
works for me Before and After Image
Try this
android:adjustViewBounds="true"
this line of code will solve the problem
android:adjustViewBounds="true"
don't forget to rotate the image