I don't know about modifying the default theme, but it's easy to make your 
own and use it in your AndroidManifest.xml so you don't have to set it on 
each TextView.

You can refer to your text appearance from a TextView style in your 
styles.xml:

<style name="BodyTextView" parent="android:style/Widget.TextView">
<item name="android:textAppearance">@style/TextAppearance</item> 
</style> 

Then you can refer to the TextView style from a theme in your styles.xml:

<style name="Theme.MyTheme" parent="@android:style/Theme.NoTitleBar">
<item name="android:textViewStyle">@style/BodyTextView</item> 
</style>

Then you can use this theme on the application or activity elements in your 
AndroidManifest.xml (or set it programatically):

<activity
    android:theme="@style/Theme.MyTheme"
    ...

That will apply your text appearance to the TextView's used without having 
to put style attributes on them directly..

On Sunday, November 4, 2012 3:40:29 AM UTC-8, onigunn wrote:
>
> Hi there,
>
> I defined an own TextApperance style in my app which inherits from the 
> default style
>
> <style name="TextAppearance" parent="@android:style/TextAppearance" >
>>
>>         <item name="android:textSize">18dp</item>
>>
>>         <item name="android:textColor">@android:color/black</item>
>>
>>         <item name="android:typeface">sans</item>
>>
>>     </style>
>>
> Now I have to apply this to each TextView which I declare in my app. Is 
> there a way to apply my custom TextAppearance as default for the whole 
> application?
>
> Best,
>
> oni 
>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to