Skip to content

VAdaihiep/ImageViewKeepRatio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageViewKeepRatio

Android ImageView keep ratio width/height.

Usage

<com.va.imageviewkeepratio.ImageViewKeepRatio
        xmlns:va="http://schemas.android.com/apk/res/com.va.imageviewkeepratiosample"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:scaleType="centerCrop"
        va:width_height_ratio="0.5" />

width_height_ratio = width/height.
If not set, ImageView's ratio will be image resource's width / image resource's height.

About

Android ImageView keep ratio width/height.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages