Android library project uses declare-styleable — how to compile?

前端 未结 6 777
春和景丽
春和景丽 2020-12-18 21:09

I have a custom preferences control that I have defined a few attributes for in values/attrs.xml. Just to focus the conversation, here is an example of attributes that coul

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 21:45

    Me too had the same problem. My app not detected the library-project styleable xml.

    I tried this:

    My Library Project package : com.lib.mylibrary My Application Project package : com.app.myapp

    I tried xmlns:custom="http://schemas.android.com/apk/res/com.app.myapp

    instead of xmlns:custom="http://schemas.android.com/apk/res/com.lib.mylib

    It worked fine ie. try

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

    instead of

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

    I got this idea here

提交回复
热议问题