How to reference a drawable from a library project into a main project's layout in android?

后端 未结 2 1665
攒了一身酷
攒了一身酷 2021-01-01 17:07

I have a android library project and reusable drawable resources in it.
Lets say package name is: com.vijay.mylib;

Then i have a main project

2条回答
  •  没有蜡笔的小新
    2021-01-01 18:02

    You probably would need to add your own uri for library and use it to refer to drawable.

    xmlns:vijay="http://schemas.android.com/apk/res/com.vijay.mylib"
    

    Then you should be able to access drawable using

    @vijay:drawable/myImage
    

提交回复
热议问题