I declare some custom attributes in res/values/attrs.xml. Now I want to refer to them in both the res/values/styles.xml where they should get added to the app theme and a layout file (located in res/layout/) like I do with android attributes by ?android:attr/someAttribute.
Questions:
- Do I have to specify a namespace anywhere? Where? and even more important: Why / Why not?
- How does this effect the
?android:attr/someAttribute-like part? How has this to look? If there are multiple "looks": Why isn't there only one? - Where is the difference between
xmlns:custom="http://schemas.android.com/apk/res-auto"andxmlns:custom="http://schemas.android.com/apk/res/com.example.awesomeproject"(wherecom.example.awesomeprojectis the package of the app also noted in the AndroidManifest.xml)? - How do the answers to the above questions change, if I move the attrs.xml and the corresponding styles.xml into an Android Library Project wich is on the built path? and even more important: Why?
0 comments:
Post a Comment