Home > database >  I do not fit the image I received from the user in Android studio fully into the imageview
I do not fit the image I received from the user in Android studio fully into the imageview

Time:01-11

enter image description here

this is my application. I want the images in this recycler view to fill the whole screen. As in Instagram (I set the width of the Image View to match parent)

enter image description here

I want it to look like this

CodePudding user response:

try setting your imageview width to 0dp and if this doesn't work then try setting scaleType to fitXY. Let me know if this works or not!

CodePudding user response:

Try using adjustViewBounds attribute, also you can use scaleType attribute if you want to scale the image:

<ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:src="@drawable/ic_launcher_background" />
  • Related