tags:

views:

60

answers:

1

Hello,

I have a problem while creating styles in android:

When I use

android:textAppearance="?android:attr/textAppearanceSmall"

in Button for instance, that's working fine, but if I create a styles.xml like:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="smalltext" parent="@style/Text">
        <item name="android:textSize">10sp</item>
        <item name="android:textColor">#FFF</item>
        <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
    </style>
</resources>

and replace in Button:

style="@style/smalltext"

nothing is taken into account.

Would you have any idea of what could be wrong ?

thanks a lot, Luc

+2  A: 

Keep in mind that styles will not be applied in the layout view in Eclipse. You'll have to deploy the application to a device (or the emulator) to see the changes.

Erich Douglass
That was something I didn't know... :-( I'll check this tonight.Thanks a lot,Luc
Luc
Thanks a lot, this was the problem.By the way, eclipse seems to complain with the following item in the styles.xml:<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>where as android:textAppearance=?android:attr/textAppearanceSmall is the correct one for other widget for instance.I cannot find the correct syntax in google.Thanks a lot,Luc
Luc