Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android have Aspect Fill concept similar to iOS?

Tags:

android

Is there any concept related to IPhone Aspect Fill within Android.I want to include this same concept on my android image on imageview. Please give me the code snippet for this concept?

like image 345
ADIT Avatar asked Jul 27 '12 10:07

ADIT


People also ask

How do I make an image circular in Android?

Simply put a circular_crop. png in your drawable folder which is in the shape of your image dimensions (a square in my case) with a white background and a transparent circle in the center. You can use this image if you have want a square imageview.

What is adjust view bounds in Android?

android:adjustViewBounds—If set to true, the attribute adjusts the bounds of the ImageView control to maintain the aspect ratio of the image displayed through it. android:resizeMode—The resizeMode attribute is used to make a control resizable so we can resize it horizontally, vertically, or around both axes.


1 Answers

If you want an ImageView that both scales up and down while keeping the proper aspect ratio, add this to your XML:

android:adjustViewBounds="true" android:scaleType="centerCrop" 

Look this.

like image 183
Chirag Avatar answered Sep 20 '22 20:09

Chirag