ios日期选择器显示月号而不是名称 [英] ios date picker display month number instead of name

查看:139
本文介绍了ios日期选择器显示月号而不是名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,日期选择器显示1 - 2014年1月。

By default, the date picker shows 1 - January - 2014.

用户可以选择

1 - 1 - 2014?

1 - 1 - 2014 ?

如何?谢谢!

推荐答案

您不能将日期选择器更改为该格式。 Apple提供以下日期标记模式,每个模式都有自己的格式:

You can't change the date picker to that format. Apple provides you the following datepicker modes, each of them has its own format:


UIDatePickerModeTime

UIDatePickerModeTime

日期选择器显示小时,分钟和(可选)AM / PM指定。显示的确切项目及其顺序取决于区域设置。这种模式的一个例子是[6 | 53 | PM]。

The date picker displays hours, minutes, and (optionally) an AM/PM designation. The exact items shown and their order depend upon the locale set. An example of this mode is [ 6 | 53 | PM ].

UIDatePickerModeDate

UIDatePickerModeDate

日期选择器显示月份,月份和年份。这些项目的
的确切顺序取决于区域设置。这种模式的一个例子是
[November | 15 | 2007]。

The date picker displays months, days of the month, and years. The exact order of these items depends on the locale setting. An example of this mode is [ November | 15 | 2007 ].

UIDatePickerModeDateAndTime

UIDatePickerModeDateAndTime

日期选择器显示日期(统一日,星期,月份和天
的月份值)加上小时,分钟和(可选)AM / PM
名称。这些项目的确切顺序和格式取决于
区域设置。这种模式的一个例子是[Wed Nov 15 | 6 | 53 | PM]。

The date picker displays dates (as unified day of the week, month, and day of the month values) plus hours, minutes, and (optionally) an AM/PM designation. The exact order and format of these items depends on the locale set. An example of this mode is [ Wed Nov 15 | 6 | 53 | PM ].

UIDatePickerModeCountDownTimer

UIDatePickerModeCountDownTimer

日期选择器显示小时和分钟值,例如[1 | 53]。
应用程序必须设置一个定时器,以适当的间隔触发,
设置日期选择器,以秒为单位。

The date picker displays hour and minute values, for example [ 1 | 53 ]. The application must set a timer to fire at the proper interval and set the date picker as the seconds tick down.

如果您想要任何其他格式,您必须实现自己的datePicker。

If you want any other format, you must implement your own datePicker.

这篇关于ios日期选择器显示月号而不是名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆