Android Studio:Drawable 文件夹:如何为多个 dpi 放置图像? [英] Android Studio: Drawable Folder: How to put Images for Multiple dpi?

查看:40
本文介绍了Android Studio:Drawable 文件夹:如何为多个 dpi 放置图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 在打开的对话框中,在 Resource Type 选择 drawable"
  • 在列表可用限定符中选择密度,然后单击中间的向右箭头.
  • 选择您喜欢的密度,然后按确定
  • Hi as per android documentation the drawable folder needs to have multiple sub-directories for images of different dpis. However in Android Studio creating any sub directory in the drawable folder causes it to fail to detect any images at all. On the other hand if an image is placed directly in the drawable folder it gets detected and becomes available for use view R.drawable.ImageName. In this case how do we use different dpi images for the same ImageName?

    解决方案

    The standard procedures are:

    1. Choose Project > app > scr > main
    2. Right click "res", choose "New" and choose "Android resource directory"
    3. In the opened dialog, at Resource Type choose "drawable"
    4. In the list Available qualifier choose Density, then click the right arrow at the middle.
    5. Choose the Density that you like then press OK

    这篇关于Android Studio:Drawable 文件夹:如何为多个 dpi 放置图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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