QuickAnswer
by

Android application development, margins can be created at the top and bottom of ImageView

Android application development, margins can be created at the top and bottom of ImageView

With Android application development, margins can be created at the top and bottom of ImageView

Android Studio Version 4.1.2
Kotlin 1.4.31

If you place an ImageView inside a ScrollView, there will be margins (gap) at the top and bottom of the ImageView.

Solution

add android:adjustViewBounds="true"

example

<ImageView
    android:id="@+id/imageUsage"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    android:adjustViewBounds="true"
    app:srcCompat="@drawable/ic_usage"/>
CONTENTS
Web Browser