I have created several files in a res/values/styles.xml file. Here's
one of them:
<style name="BlueOnWhite" parent="@android:style/TextAppearance">
<item name="android:textColor">#FFFFFF</item>
<item name="android:background">#0033FF</item>
</style>
I can apply the style to a single element in the xml by setting the
style element like this:
<TextView
android:text="@string/size_label"
android:id="@+id/sizeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/BlueOnWhite"
android:layout_gravity="center_vertical"/>
So, that works, and I notice that change. But what I really want to
do is use the style above to apply to my entire application. I
thought I'd be able to use this line:
this.getApplicationContext().setTheme(R.style.BlueOnWhite);
before the super.onCreate of the first activity. But it doesn't
work. Should it?
What am I missing?
I need the ability to set the style programatically and I really don't
want to have to set each element individually.
--
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