简体   繁体   中英

Scaled dpi bitmaps for various screen sizes' backgrounds

With Android's nine-patch generator ( http://romannurik.github.io/AndroidAssetStudio/nine-patches.html ), what resolution do you recommend for the base, xhdpi, to retrieve the other scaled dpi bitmaps if I wanted to fit a screen's background on devices ranging from Android wear to Nexus 5 to Android TV?

Are there any alternative ways for this without hardcoding certain dimension-sized png files for particular device screens? Thanks!

The best alternative is to use xml drawable, it fits great on all displays. read more here: http://developer.android.com/guide/topics/resources/drawable-resource.html

Also, if you plan to make you app for android 5 or later then drawable vector is another great choice: http://developer.android.com/reference/android/graphics/drawable/VectorDrawable.html

If non of these did the job for you I recommend you to make your resources for hdpi and xxhdpi, these tow should be scaled with no problems most of time.

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