如何显示与ImageView的图像全尺寸? [英] How to display an image full size with ImageView?
问题描述
我有问题,当我尝试显示与全尺寸的图像。 我试着用WRAP_CONTENT显示图像。但它是较小的实像。
I have problem when I try to display the image with full size. I tried to display image with wrap_content. But it is smaller real image.
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/screen1_logo" />
我去这个图片的属性,并看到一些信息:dimentions 211 x 74。然后,我试着用固定的宽度和高度显示图像。我看到它的大。
I go to the properties of this image and see some information: dimentions 211 x 74. Then I try to display image with fixed width and height. I see it's bigger.
<ImageView
android:layout_width="211px"
android:layout_height="74px"
android:src="@drawable/screen1_logo" />
是不是这样?我们必须解决规模与全尺寸显示图像? 请帮我解释和解决这个问题。
is it right way? do we must to fix size to display image with full size? Please help me to explain and resolve this problem.
推荐答案
添加 scaleType
您的ImageView
add a scaleType
to your ImageView
<ImageView
android:scaleType="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/screen1_logo" />
从文档安卓scaleType =中心
中心视图中的形象,但是不执行任何缩放。
Center the image in the view, but perform no scaling.
这篇关于如何显示与ImageView的图像全尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!