How to remove such empty edges from imageView

enter image description here

<LinearLayout android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignBottom="@+id/linearLayout3" android:layout_toStartOf="@+id/linearLayout3" android:layout_width="wrap_content" android:layout_height="match_parent"> <ImageView android:layout_alignParentLeft="true" android:adjustViewBounds="true" android:src="@drawable/test_image" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> 
  • Try setting a wrap_content width - Yuriy SPb
  • after setting the wrap_content image wrap_content to the left edge, but to the right is still the same gap - kalugin1912
  • It is also worth noting that this problem is only on the tablet - kalugin1912
  • one
    Try instead of using LinearLayout FrameLayout to use and set the desired gravity there. In general, there are not enough details on how it should look. It seems that the problem is not in the picture at all, but in how the positioning of widgets in relativeLayout works and how wrap_content and match_parent work - YuriiSPb
  • one
    and how do you want to do? To image stretched? Is it clipped? Or what? - Vladyslav Matviienko

1 answer 1

The question is not complete, what do you want to get in the final result? stretched image or filled cropped?

1) In any case, play with the android parameter : scaleType

Personally, I would cut android: scaleType = "centerCrop"

2) Once the problem is on the tablets, it may be worthwhile for them to add their image resources through modifiers that are more elongated in width (widescreen) due to the specifics of the devices, but the centerCrop also needs to be made so that the karinka is automatically adjusted to the size of the ImageView on the smaller side