Skip to main content

Posts

Showing posts with the label styling

Using resources referenced in the current theme

I find myself again trying to use resources set in the current theme inside my Android application and running into difficulties. Following the rough guidelines found here for theme attribute value reuse I was originally trying to create a selector like so <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="?android:attr/selectableItemBackground" /> <item android:drawable="@color/transparent" /> </selector> where the pressed state drawable is declared like so <item name="selectableItemBackground">@android:drawable/item_background</item> in the current ICS themes xml doc themes xml doc . This compiles fine in eclispse (whereas if i spell the attr wrong it will give an error or reffng @android:drawable/item_background directly will inform me the draw