位图尺寸出现在不同的Andr​​oid设备不同 [英] Bitmap size appears different in different android device

查看:123
本文介绍了位图尺寸出现在不同的Andr​​oid设备不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想设置在图像的的ImageView 但设置它出现在不同的Andr​​oid设备上的大小不同,图像后

Hello I am trying to set the image in the ImageView but after setting the image it is appearing different in size on different android device.

索尼žExperia还4.3

Sony Z Experia 4.3

三星ŸDous 2.3它覆盖了整个图像屏幕宽度

Samsung Y Dous 2.3 where it covered the entire image to the screen width

下面是布局

<ImageView
    android:id="@+id/logo"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:padding="5dip"
    android:scaleType="fitStart" />

我怎么能做出这样它看起来同索尼的Xperiaž。任何想法?

How can I make such that it appear same as Sony Z Xperia. Any idea ?

在此先感谢

推荐答案

在Android的你可以选择
华电国际,
MDPI,
xdpi等。

In android you have the option hdpi, mdpi, xdpi,etc..

该文件夹,你有你的根据设备的分辨率来创建不同的图像,并把你的图片在那里确认您的设备的分辨率和密度类别后。

folders for that , you have to create different images according your device resolution and put your images at there after confirming your device resolution and density category.

对于比较基准,为什么它会发生,你可以看到这里

for the more reference why it'll happen you can see here

在这里,我解释一些图表可能对您有所帮助。

here i explain some chart may be helpful to you.

Low density Small screens QVGA 240x320 (120dpi):

layout-small-ldpi (240x320)  
layout-small-land-ldpi (320x240)

Low density Normal screens WVGA400 240x400 (x432) (120dpi):

layout-ldpi  (240 x 400 )
layout-land-ldpi  (400 x 240 )

Medium density Normal screens HVGA 320x480 (160dpi):

layout-mdpi (320 x 480 )
layout-land-mdpi (480 x 320 )

Medium density Large screens HVGA 320x480 (160dpi):

layout-large-mdpi (320 x 480 )
layout-large-land-mdpi (480 x 320)

Galaxy Tab ( 240 dpi ):

layout-large  (600 x 1024) 
layout-large-land  (1024 x 600)

High density Normal screens WVGA800 480x800 (x854) (240 dpi):

layout-hdpi (480 x 800)
layout-land-hdpi (800 x 480)

Xoom (medium density large but 1280x800 res) (160 dpi):

layout-xlarge (800 x 1280)
layout-xlarge-land (1280 x 800)

这篇关于位图尺寸出现在不同的Andr​​oid设备不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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