Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the default ScaleType of ImageView? [duplicate]

Tags:

android

What's the default ScaleType of ImageView?If I put an image which is 400 pixels x 400 pixels on a normal screen (320x480) without specifying ScaleType, how will the image be scaled?

Thanks.

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent">      <ImageView          android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:src="@drawable/big_image"     /> </RelativeLayout> 
like image 544
user256239 Avatar asked Jun 01 '10 17:06

user256239


People also ask

What is ScaleType?

ScaleType options are used for scaling the bounds of an image to the bounds of the image view. ScaleType configuration properties for ImageView in Android are CENTER, CENTER_CROP, CENTER_INSIDE, FIT_CENTER, FIT_END, FIT_START, FIT_XY and MATRIX.

What is ImageView code?

Displays image resources, for example Bitmap or Drawable resources. ImageView is also commonly used to apply tints to an image and handle image scaling. To learn more about Drawables, see: Drawable Resources.

Which attribute is used to set an image in ImageView?

src: src is an attribute used to set a source file or you can say image in your imageview to make your layout attractive.


1 Answers

FIT_CENTER:

ImageView.ScaleType FIT_CENTER

Scale the image using CENTER. From XML, use this syntax: android:scaleType="fitCenter".

like image 125
Robby Pond Avatar answered Sep 28 '22 19:09

Robby Pond