How can i specify a drawable source with an attr attribute?

dtvqmqkziw

New Member
I am writing an xml for a drawable. My question is: is there a way to give the src property a reference to a attribute defined in the attr.xml file ? I've tried:\[code\]android:src="http://stackoverflow.com/questions/11268272/?image"\[/code\]and \[code\]android:src="http://stackoverflow.com/questions/11268272/?attr/image"\[/code\]None of them seem to work. Here's my attr.xml:\[code\]<?xml version="1.0" encoding="utf-8"?><resources> <attr name="image" format="reference"></attr></resources>\[/code\]and where i define the values, which are related to theme:\[code\]<resources> <style name="HOLO" parent="@android:style/Theme.Black"> <item name="android:textColor">#00FFFF</item> <item name="image">@drawable/holo_vcard_settings_icon</item> </style> <style name="HOLO_LIGHT" parent="@android:style/Theme.Light"> <item name="android:textColor">#FF00FF</item> <item name="image">@drawable/holo_light_vcard_settings_icon</item> </style></resources>\[/code\]
 
Back
Top