在Iphone的日期选择器中插入空白值 [英] Insert blank value in date picker in Iphone

查看:64
本文介绍了在Iphone的日期选择器中插入空白值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日期选择器,该日期选择器使用操作表显示。
我想在日期选择器中插入一个空白值并将其设置为默认值。
仅应在用户选择时更改。
这可能吗?
如果是,怎么办?
感谢所有宝贵的建议。

I have a date picker which is shown using an action sheet. I want to insert a blank value in date picker and set it as default value. It should change only on user selection. Is this possible? If yes how? All valuable suggestions are appreciated.

推荐答案

UIDatePicker仅支持某些模式,不允许这种自定义(在旋转选择器中添加空白或自定义数据)。哦,文档指示它也不是从 UIPickerView 继承的,所以您不能轻易获得它所使用的自定义选择器视图对象。

UIDatePicker only supports certain modes and doesn't allow this kind of customization (adding in blank or custom data into the spinning pickers). Oh, the documentation indicates it doesn't inherit from UIPickerView either so you can't easily get at the custom picker-view object that it works with.

为什么不创建自己的实现UIPickerViewDelegate的视图和控制器对并创建自己的视图-您可能会发现更多详细信息和有用的提示

Why not create your own view and controller pair that implements the UIPickerViewDelegate and create your own - you may find a little more detail and useful hints in this related question.

或者,考虑不同的&轻松完成您要完成的工作的方式。

Or, consider a different & less painful way to accomplish what you're trying to do.

这篇关于在Iphone的日期选择器中插入空白值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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