如何更改我的日期选择显示在只有一个月,日期和年

时间:2022-09-27 20:14:06

The default UIDatePicker shows both the date and time. I need to show only the month, day and year like this:

默认的UIDatePicker显示日期和时间。我只需要像这样展示一个月,一天,一年:

如何更改我的日期选择显示在只有一个月,日期和年

How can I change the picker to this?

我怎样才能把采摘机换成这个呢?

3 个解决方案

#1


8  

Just set the date pickers mode.

只需设置日期选择器模式。

datePicker.datePickerMode = UIDatePickerModeDate;

"Date" is also an option in the inspector in IB.

“日期”也是IB的检查器中的一个选项。

#2


0  

Did you check the page where the second image is there ?

你检查了第二张图片所在的页面了吗?

Date Picker for iPhone Web Application

iPhone Web应用程序的日期选择器

seems like it has answer to your question!

似乎它能回答你的问题!

#3


0  

UIDatePicker Class Reference Refer this

UIDatePicker类引用这一点

#1


8  

Just set the date pickers mode.

只需设置日期选择器模式。

datePicker.datePickerMode = UIDatePickerModeDate;

"Date" is also an option in the inspector in IB.

“日期”也是IB的检查器中的一个选项。

#2


0  

Did you check the page where the second image is there ?

你检查了第二张图片所在的页面了吗?

Date Picker for iPhone Web Application

iPhone Web应用程序的日期选择器

seems like it has answer to your question!

似乎它能回答你的问题!

#3


0  

UIDatePicker Class Reference Refer this

UIDatePicker类引用这一点