0

In my styles.xml inside the values directory I defined my custom button as follows:

<style name="Button" parent="android:Widget.Holo.Light.Button">
    <item name="android:typeface">serif</item>
    <item name="android:layout_marginLeft">6dp</item>
    <item name="android:layout_marginRight">6dp</item>
    <item name="android:layout_marginTop">10dp</item>
    <item name="android:layout_marginBottom">10dp</item>
    <item name="android:minHeight">40dp</item>
    <item name="android:minWidth">40dp</item>
    <item name="android:paddingLeft">10dp</item>
    <item name="android:paddingRight">10dp</item>
</style>

It is working at least with my Android 4.2 device but Android 2.3 does not respect the minHeight value. I have also problems with fonts, in my TextViews Android 2.3 seems to use enormous fonts instead of the default values from the style I inherit in the following code:

<style name="TextView" parent="android:Widget.Holo.Light.TextView">
    <item name="android:padding">5dp</item>
    <item name="android:typeface">serif</item>
</style>

Is there any special thing I must do for API < 11?

Thank you so much,

Didac Perez Parera
  • 3,734
  • 3
  • 52
  • 87

1 Answers1

0

For using the holo theme in android 2.3, you shall use the androids compatibility library. For holo theme you shall use the andorid support library v7.

Check the following link for more details: http://developer.android.com/tools/support-library/index.html

Vivek Soneja
  • 850
  • 6
  • 7
  • In that website does not appear the word 'holo'. In addition, this is not the way to use the Holo Theme in Android earlier versions. – Didac Perez Parera Nov 03 '13 at 18:54
  • He means tha appcompat lib: https://developer.android.com/training/basics/actionbar/styling.html - but this is for having actionbar and some holo styles in android 2.1+ but does not enable earlier version newer style elements – Patrick Nov 03 '13 at 19:10
  • Anyway, that's not the question. – Didac Perez Parera Nov 03 '13 at 19:27