Android 4.0+中的旧主题;应用程序

Android 4.0+中的旧主题;应用程序,android,spinner,android-4.0-ice-cream-sandwich,android-theme,Android,Spinner,Android 4.0 Ice Cream Sandwich,Android Theme,我在我的活动中创建了一个微调器,当我在我的果冻豆设备上运行我的应用程序时,微调器的主题像2.x,我如何获得ICS微调器 以下是我的微调器代码: <Spinner android:id="@+id/spinnermap" style="@android:style/Theme.Holo" android:layout_width="wrap_content" android:layout_height="wrap_content"

我在我的活动中创建了一个微调器,当我在我的果冻豆设备上运行我的应用程序时,微调器的主题像2.x,我如何获得ICS微调器

以下是我的微调器代码:

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

正如你所见,我试图设置全局样式“全息”,但没有结果

我的
NumberPicker
也有同样的问题,但不记得我是如何解决的

  style="@android:style/Theme.Holo"
这不是解决办法您在HC之前的设备上不会有退路。 如果你想在HC+的整个应用程序中使用全息主题,你需要为整个应用程序声明一个主题(我假设这就是你想要的)

在您的舱单中:

android:theme="@style/MyTheme"
values/styles.xml:

<style name="MyTheme" parent="android:Theme.Light">
</style>
<style name="MyTheme" parent="android:Theme.Holo.Light">
</style>
<style name="MySpinner" parent="android:Widget.Spinner">
</style>
<style name="MySpinner" parent="android:Widget.Holo.Spinner">
</style>

values-v11/styles.xml:

<style name="MyTheme" parent="android:Theme.Light">
</style>
<style name="MyTheme" parent="android:Theme.Holo.Light">
</style>
<style name="MySpinner" parent="android:Widget.Spinner">
</style>
<style name="MySpinner" parent="android:Widget.Holo.Spinner">
</style>

现在您将在HC+上有一个下拉微调器(当然还有其他holo小部件)


但是,如果您只想将微调器“全息化”,可以执行以下操作:

<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:

<style name="MyTheme" parent="android:Theme.Light">
</style>
<style name="MyTheme" parent="android:Theme.Holo.Light">
</style>
<style name="MySpinner" parent="android:Widget.Spinner">
</style>
<style name="MySpinner" parent="android:Widget.Holo.Spinner">
</style>

values-v11/styles.xml:

<style name="MyTheme" parent="android:Theme.Light">
</style>
<style name="MyTheme" parent="android:Theme.Holo.Light">
</style>
<style name="MySpinner" parent="android:Widget.Spinner">
</style>
<style name="MySpinner" parent="android:Widget.Holo.Spinner">
</style>


谢谢你,伙计,我只是用style=“@android:style/Widget.Holo.spinner”替换了微调器的值样式,这很好,我不必只为一件事创建自定义主题。你检查过清单中的目标了吗?是的,我的应用程序适用于sdk 14到17,这就是为什么我想知道为什么全息主题不是自动的!