简体   繁体   中英

drawable-sw720dp vs drawable-hdpi, drawable-xhdpi and others

I want to provide drawables for:

  • hvga and qvga phones (but those use hdpi drawables pretty well)
  • hdpi phones
  • xhdpi phones
  • xxhdpi phones
  • 7" tablets
  • 10" tablets

I have folders:

  • drawable-hdpi (used by phones up to 480x854 screens)
  • drawable-xhdpi (used by phones like Galaxy S3)
  • drawable-xxhdpi (used by phones like Galaxy S4)
  • drawable-sw600dp (I would expect: used by 7" tablets)
  • drawable-sw720dp (I would expect: used by 10" tablets)

My original problem was, I thought resources from drawable-sw720dp are not used, but they are! Some graphic designer gave me files with different names and I did not notice. My fault.

So no problem at all.

For supporting tablets also, use large , xlarge qualifiers. Nexus 7 is a large-hdpi tablet(technically it's tvdpi , but takes images from hdpi ). So if you want to put images for Nexus 7 , make a folder named drawable-large-hdpi and put the images there.

Now regarding the 10 inch tablets case, they are xlarge devices and their densities can change from mdpi to xhdpi (Nexus 10). But many have resolution of 1280 * 800 and they are mdpi devices.

Create drawable folder like this

// for Phones
drawable-mdpi
drawable-hdpi
drawable-xhdpi
drawable-xxhdpi

//for 7 inch tablets
drawable-large-mdpi
drawable-large-hdpi(for Nexus 7)

// for 10 inch tablets
drawable-xlarge-mdpi
drawable-xlarge-xhdpi(for nexus 10)

Source of answer

我最初的问题是,我认为未使用来自drawable-sw720dp的资源,但它们确实在使用!

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