本文介绍了更改按钮的DatePickerDialog顺序为Android 4.0.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 DatePickerDialog

  DatePickerDialog datePickerDialog =新DatePickerDialog(getActivity(),这,年,月,日);

,并显示在的Andr​​oid 4.0.3(API 15)设备,它看起来像这样:

正如你看到上面的取消按钮在左侧显示,而设置按钮位于右侧。但是在Android 2.3.3,按键顺序是周围的其他方法。

所以,我怎样才能改变按钮 DatePickerDialog 的'为了以示设置的左侧按钮, 取消的Andr​​oid 4.0.3 设备上右侧的按钮?


解决方案

You don't. Either you leave them alone, or you create your own dialog with your own DatePicker that has the buttons in the wrong order.

Please bear in mind that most users of Android apps use more than just your Android app. They actually use other apps. Some of those other apps will use a DatePickerDialog, and those dialogs will have the button order as shown in your screenshot. It is much more important for your users for you to stick to the device standard (so all their DatePickerDialogs work the same) than it is for you to force the wrong button order on some devices.

这篇关于更改按钮的DatePickerDialog顺序为Android 4.0.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 17:42