Below is the code to adjust ImageView taking full width.
It is mainly required when we need to show cover photos which take the full width of the screen.
The images that are in landscape looks ok, but we find a problem with the portrait picture.
So I define android:adjustViewBounds="true" and android:scaleType="centerCrop" on the xml file.
Below is the code
<ImageView
android:id="@+id/cover_picture"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
/>
0 Comment(s)