简体   繁体   中英

Why the same image put in the “drawable-hdpi” directory shows different if I put it into the “drawable” directory

I have encountered a thing that I am not really able to understand.

In my application I use an image (64x64 px).

Now, ON THE SAME DEVICE (Samsung Galaxy ACE, Gingerbread):

  • If i put the above mentioned image in the "drawable-hdpi" directory it shows on the screen in a certain size;
  • If i put THE SAME IMAGE in the "drawable" directory it shows in a different size , to be precise it shows BIGGER .

I really do not understand this!!

It is the same image on the same device !!!

Please is anybody able to explain to me this inexplicable behavior?

Thanks a lot to anybody so kind to clarify this to me.


EDIT EDIT EDIT EDIT EDIT EDIT

See the screens. The image in question is the background of each cell in the GridView

In the "drawable-hdpi" directory:

在此处输入图片说明

In the "drawable" directory

在此处输入图片说明

Android scales your image while keeping the aspect ratio. you can read more about it here and you can also put the file in drawable-nodpi as @Nobu said.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM