嗨,我首先使用目标 api 3.0 开发了项目。当时它显示数字选择器如下
现在我用 15(4.0.3) 更改了目标和最低版本。它仍然显示旧的数字选择器。
我想看看下面的选择器。
嗨,我首先使用目标 api 3.0 开发了项目。当时它显示数字选择器如下
现在我用 15(4.0.3) 更改了目标和最低版本。它仍然显示旧的数字选择器。
我想看看下面的选择器。
The problem can be resolved in one of several ways,
1 If you want to change the look and feel of all the date/time pickers in your app, you could apply a proper theme to the application
From Android 3.0 and afterwards app could use one of the following themes:
Applying one of the last two themes to your app could resolve your problem:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/android:Theme.DeviceDefault" >
2 If you have no android:theme set for your app, then be aware of that the uses-sdk tag could decide the actual theme in use
See http://android-developers.blogspot.com/2012/01/holo-everywhere.html
So setting android:targetSdkVersion to a number equals or greater than 11 can resolve your problem.
3 If you are using a picker dialog and just want to change the look & feel of the single picker, then you could set a theme to the dialog only.
Like this:
Dialog dialog = new DatePickerDialog(this, AlertDialog.THEME_DEVICE_DEFAULT_DARK, new OnDateSetListener()...);
Note that AlertDialog.THEME_DEVICE_DEFAULT_DARK an API Level 14 API, you may also choose Holo themes like AlertDialog.THEME_HOLO_DARK which is available in API Level 11.
Just need to change theme to holo in manifiest file.