Skip to content Skip to sidebar Skip to footer

Old Theme In 4.0+ App

I've created a spinner in my activity and when i run my app on my Jelly Bean device the theme of the spinner is like 2.x, how can i get the ICS one? Here's my spinner code : &l

Solution 1:

style="@android:style/Theme.Holo"

This is not the solution. You won't have a fallback on pre HC devices. You need to declare a Theme for your whole application if you want to use the holo theme in your whole app for HC+(I assume this is what you want to have).

In your Manifest:

android:theme="@style/MyTheme"

values/styles.xml:

<stylename="MyTheme"parent="android:Theme.Light"></style>

values-v11/styles.xml:

<stylename="MyTheme"parent="android:Theme.Holo.Light"></style>

Now you'll have a dropdown spinner on HC+(and also other holo widgets of course)


However if you just want to have the spinner to be "holofied" you can do this:

<Spinner
      android:id="@+id/spinnermap"
      style="@style/MySpinner"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_centerVertical="true" />

values/styles.xml:

<stylename="MySpinner"parent="android:Widget.Spinner"></style>

values-v11/styles.xml:

<stylename="MySpinner"parent="android:Widget.Holo.Spinner"></style>

Post a Comment for "Old Theme In 4.0+ App"