开发者

Is it possible to add a custom folder inside 'drawable' folder of an Android app?

开发者 https://www.devze.com 2023-01-12 01:39 出处:网络
I created this folder, tab_bar, inside \'drawable\' and added barbgnd.png. And then in my code, I tried to access it using

I created this folder, tab_bar, inside 'drawable' and added barbgnd.png. And then in my code, I tried to access it using

android:background="@drawable/tab_bar/barbgnd"

However, I go开发者_运维问答t this error

error: Error: No resource found that matches the given name (at 'background' with value '@drawable/tab_bar/barbgnd').

My objective is to further organize the files inside the drawable folder.. i.e. all images used in a Navigation Bar component in one folder, etc.

Is this not possible?

Thanks!


You're not allowed to create subfolders at drawable folder. I usually use naming prefix to organize files, i.e. navigaton_left.png, navigation_right.png etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消