TextAppearance in topic

I want the text in my topic to be TextAppearnance.Large. Here is what I do in my styles.xml (my application points to this topic 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 showing small.

Question (s):

  • What am I doing wrong when trying to use the predefined TextAppearance in my activity? That is, how to specify this TextAppearance?
  • Where are the text fields for TextAppearance.Large / Medium / Small defined?
+6
source share
2 answers

First declare the attribute as

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

But the declaration of the text or the color of the text in the subject only affects the text, which has absolutely no style or attribute anywhere, including system ones. If you add

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

even without the android:textAppearance="?android:attr/textAppearanceMedium" that Eclipse picks up, this theme will affect it, but buttons, etc. never will be.

+5
source
Themes and Styles

are defined in the themes.xml and styles.xml files of the sdk implementation in your environment (different for different versions of Android or sdk).

find your computer for themes.xml (for example, you will probably find several instances of it in the "program files / android" folder on a 32-bit Windows machine).

this post explains how to configure these attributes.

you can also set explicit size attributes to your xml layout file by changing the TextView attributes:

 <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="15sp is the 'normal' size." android:textSize="15sp" /> 

this post explains how to customize android fonts (including fontType, fontColor, shadow, bold, italic) directly in the xml layout file.

-1
source

Source: https://habr.com/ru/post/901134/


All Articles