Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextAppearance in theme

I want to set the text appearance in my theme to be TextAppearnance.Large. Here is what I am doing in my styles.xml (my application is pointing to this theme in my manifest)

<style name="myTheme" parent="android:Theme.NoTitleBar.Fullscreen">  
 <item name="android:textAppearance">@android:style/TextAppearance.Large</item>  
</style>

Problem: My text is still being displayed small.

Question(s):

  • What am I doing wrong in trying to use a predefined TextAppearance in my activity? i.e. How do specify this TextAppearance correctly?
  • Where are the TextSizes for TextAppearance.Large/Medium/Small defined?
like image 500
celoftis Avatar asked Nov 09 '11 16:11

celoftis


1 Answers

First, declare the attribute as

<item name="android:textAppearance">?android:attr/textAppearanceLarge</item>

But declaring text appearance or text color in a theme only affects text that has absolutely no style or attribute anywhere, including system-defined ones. If you add a

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Medium Text" />

without even the android:textAppearance="?android:attr/textAppearanceMedium" line that Eclipse throws in, it will be affected by this theme, but buttons and the like never will.

like image 100
Noumenon Avatar answered Oct 23 '22 05:10

Noumenon