Modifying styles programmatically
In an Android application I am writing, the styling for my various TextView
elements is defined in an xml resource. I would like enable the user to change certain styles such as android:typeface
using a PreferenceActivity
.
Is there a way to modify a style resource programmatically such that all associated widgets will update correctly? If not, must I manu开发者_Go百科ally select all widgets by id and change their styling?
Don't know whether you've found it but the Cubewallpaper sample uses preferences and that appears to do it all by hand in the onSharedPreferenceChanged event.
You can keep the preference keys in a resource file but that's about it it would appear.
精彩评论