Both in the O'Reilly online tutorials and in the Meetups, I have heard it said often: to make sense of what really goes on in the XML for styles and themes, you often have to break down and read the source code; especially if you are doing anything custom.
I can't approve of that state of affairs, it really does sound like a failure of the documentation, but like the old joke goes: when you run up against a sheer cliff, even the fastest runner finds his feet useless. There's not much we can do other than bit the bullet and read the code. On Sep 7, 3:07 am, mort <[email protected]> wrote: > OK, found a working solution - no idea if it was indented that way, > SDK documentation is very fuzzy and incomplete in this area... > > To stay with my example: > In attrs.xml, define the "CSS class" ;): > <resources> > <attr name="headline" format="reference" /> > </resources> > > In styles.xml, define the style to use for each theme: > <style name="Theme.Android.Black" parent="android:Theme.Black"> > <item name="android:textViewStyle">@style/textForBlack</item> > <item name="headline">@style/headlineForBlack</item> > </style> > <style name="Theme.Android.Light" parent="android:Theme.Light"> > <item name="android:textViewStyle">@style/textForLight</item> > <item name="headline">@style/headlineForWhite</item> > </style> > > In the layout, refer to the attribute with "?": > <TextView ..... style="?headline" /> > > Hope this helps other people with similar problems... > > On a related topic: Does anybody have an idea how to support themes > from external (ZIP?) files including the required drawables? Or, in > other words, user skins. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

