Issue
Ok this is very stupid but i can't find a way out. As a brief test I put bg.png into drawable/drawable-xhdpi but when i reference it
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/details_parent"
android:background="@drawable/bg">
...
</LinearLayout>
I get this error Couldn't resolve resource @drawable/bg
I tried copying it in every drawable-somethingDPI folder, because that's what I will do when I'll have the different size of it, but still nothing.
Finally, if I simply move it to the parent folder /drawable
everything works.
But this is nonsense! I want to put the different sized pictures in their respective -DPI folder to support the various dpi buckets.
What am I missing?
Solution
that's is a very sense one as you give it path
@drawable/bg
and the real path is
drawable/drawable-xhdpi/bg
when you create the different drawable folders create it in the res package not inside the drawable itself
Answered By - Sattar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.