Android Drawable Image not Showing

风流意气都作罢 提交于 2019-12-02 01:31:14

The problem is that your drawable image file is only available drawable-hdpi folder. In order to set the background properly, you can do two following ways.

  1. You should place your image file to all drawable directories. I mean you should put that image into drawable-ldpi, drawable-mdpi and so on. Also you should be careful about the size of the image because each folder corresponds to screen sizes. Please check out this API Guide

  2. Second way is the alternative for the first one. Create a directory within res/ folder and name it as drawable and then move your image file from drawable-hdpi to drawable.

Then, clean the project and relaunch.

Hope this may help.

If you extend your activity from Activity, then using android:src instead of app:srcCompat.

This is solved a problem in my case.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!