当前位置: 动力学知识库 > 问答 > 编程问答 >

How to placed my images(such as background) placed in my android project?

问题描述:

Is it enough to create a drawable folder and put them all images only there? I have to scale all images and put them all according to their size? (to drawable-xhdpi, drawable-xxhdpi, drawable-mdpi, drawable-hhdpi). Thanks

网友答案:

This link explains very good the functionality of the drawable and how to support another screen sizes: http://developer.android.com/guide/practices/screens_support.html

Drawable folder is the default folder. I mean, if you don't have the other specific folders (drawable-xhdpi, for example) and your device has this dimension, it will use the default folder.

So, asking to your cuestion, it is recommendable to create a folder for each size(drawable and layout) but you are not obligated (depends on you).

网友答案:

From the Android Developer site, there's this paragraph.

To optimize your application's UI for the different screen sizes and densities, you can provide alternative resources for any of the generalized sizes and densities. Typically, you should provide alternative layouts for some of the different screen sizes and alternative bitmap images for different screen densities. At runtime, the system uses the appropriate resources for your application, based on the generalized size or density of the current device screen.

This confirm that you have to create differents images for every resolution and density you want to support.

Remember you can exclude some screen typology through the Android Manifest configuration

分享给朋友:
您可能感兴趣的文章:
随机阅读: