How can I style every font in every TextView using 1 line of code?
I want to style all the hundreds of textviews that I've created over dozens of file using a global style. how can i开发者_如何转开发 do this?
You need to create separate style resources in /res/values/style.xml
here is a sample style
<style name="style_title">
<item name="android:textColor">#ffffffff</item>
<item name="android:textSize">18dip</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowDx">1</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">2</item>
</style>
You can find more info here : http://developer.android.com/guide/topics/ui/themes.html
The answer can be found here. Maybe even a few additional chunks of info.
Setting global styles for Views in Android
精彩评论