Reputation: 16653
I have made an component for Android, which uses two drawables.
Using static values for the drawables in the code, the component works but now I want to declare the values in the properties (XML) does anyone know how to do this?
*Edit; Is there a way to do this without using the attrs.xml?
Upvotes: 0
Views: 2464
Reputation: 1006724
You will need to set up a res/values/attrs.xml
file to declare the attributes, then go through some code to retrieve those values inside of your View
's constructor. I have a sample here that demonstrates the technique.
Upvotes: 4