什么是ImageView的默认ScaleType? [英] What's the default ScaleType of ImageView?

查看:540
本文介绍了什么是ImageView的默认ScaleType?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是ImageView的默认ScaleType?如果我把一个图像,它是没有指定ScaleType 400像素×400像素的标准屏幕(分辨率320x480)上,如何将图像缩放?

感谢。

 < XML版本=1.0编码=UTF-8&GT?;
< RelativeLayout的的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT>

    < ImageView的
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =FILL_PARENT
        机器人:SRC =@可绘制/ big_image
    />
< / RelativeLayout的>
 

解决方案

<一个href="http://developer.android.com/reference/android/widget/ImageView.ScaleType.html">FIT_CENTER

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>

解决方案

FIT_CENTER

这篇关于什么是ImageView的默认ScaleType?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆