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
Category:Android
Pub.date:2021-03-16
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
JavaScript
Unreal Engine
CakePHP4
CakePHP4
Flutter
Flutter
Other
JavaScript
JavaScript
CakePHP4
Web Server
Photoshop
Unreal Engine
CakePHP4
Web Browser
Web Server
iOS
Android
Web Browser
CakePHP4
Plesk
Illustrator
Plesk
Web Server
Web Server
CakePHP3
Web Browser
CakePHP3
JavaScript
JavaScript
CakePHP3
CakePHP3