Android 4.1 - 不能将旧样式用于numberpicker和spinner

时间:2015-05-02 08:49:54

标签: numberpicker

我想将旧样式用于numberPicker和spinners。 在api 21上一切都很好但是在api 16设备上显示了全息主题中的numberPicker。

  

的AndroidManifest.xml

    <uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="21" />
<applicationstrong text
    android:name=".App"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
  

值/ styles.xml

<resources xmlns:android="http://schemas.android.com/apk/res/android">

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:windowFullscreen">true</item>
    <item name="android:actionBarStyle">@style/MyActionBarTheme</item>
    <item name="android:spinnerMode">dialog</item>
</style>

<!-- ActionBar styles -->
<style name="MyActionBarTheme" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@color/mondi_orange</item>
    <item name="android:titleTextStyle">@style/myTheme.ActionBar.Text</item>
</style>

<!-- ActionBar text styles -->
<style name="myTheme.ActionBar.Text" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/white</item>
    <item name="android:textAllCaps">true</item>
    <item name="android:textStyle">bold</item>
</style>

<!-- Android old theme -->
<style name="oldStyle" parent="@android:style/Theme.Light" />

  

值-V14 / styles.xml

<resources>

<!--
    Base application theme for API 14+. This theme completely replaces
    AppBaseTheme from BOTH res/values/styles.xml and
    res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>

  

layout.xml

<Spinner
        android:id="@+id/spinner1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/oldStyle"
        android:entries="@array/suppliers_list"
        android:prompt="@string/supplier" />

0 个答案:

没有答案