开发者

How can I style every font in every TextView using 1 line of code?

开发者 https://www.devze.com 2023-03-20 04:45 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消