Android Button TextAppearance


Answer :

The values of attributes defined using textAppearance are applied before the values of attributes in a style. A Button is a TextView with a style applied, and the default style of a Button will override your textAppearance (Android 2.3 for example will set it to ?android:attr/textAppearanceSmallInverse) and textColor.

textAppearance excepts styles as values, android:textAppearance="@style/login_button_text_appearance" is the normally correct way to set a textAppearance, but not for a Button:

If you're changing the text colour of a Button, you should also enforce a custom background image because if you don't, one device will use a dark background image (motorola defy) and another will use a light image (htc desire) which may make the text difficult to read.


I think you should use :

style = "@style/login_button_text_appearance" 

instead of:

android:textAppearance="@style/login_button_text_appearance" 

The android:textAppearance is just an attribute like any other attribute ( android:textSize, android:textStyle, etc..) , and the value of the style is not acceptable as a value for that attribute.

EDIT :

<Button     android:id="@+id/login_btn_login"     style="@style/login_button_text_appearance" /> 

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable