Adding Custom dpi Drawable Folder Android Studio (ACDDFAS)

Hi, as per android documentation, drawable folder should have multiple sub-directories for images of different dpis. However in Android Studio, creating sub directories in drawable folder causes it to fail to detect the images at all. On the other hand, if the images are placed directly in drawable folder, they are detected and available for use, view R.drawable.ImageName. In this case, how do we use different dpi images for the same ImageName?

Enlightenment

The standard procedure is as follows.

  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 of Available qualifiers choose Density, then click the right arrow in the middle.
  5. Choose the Density that you like then press OK

The method to add the folder is correct. I appreciate that. But to access the folder, you have to change the Project Structure View from  Android  to  Project . Here navigate to res->xxhdpi


Post a Comment

Previous Next

نموذج الاتصال