Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用日期选择器替换IOS键盘_Ios_Swift_Keyboard_Uidatepicker - Fatal编程技术网

用日期选择器替换IOS键盘

用日期选择器替换IOS键盘,ios,swift,keyboard,uidatepicker,Ios,Swift,Keyboard,Uidatepicker,我需要点击一个按钮,用datepicker替换已经打开的键盘!在互联网上搜索,我只找到如何使用datepicker作为文本字段的输入。还有别的办法吗?谢谢大家! 这将用UIDatePicker替换键盘: UIDatePicker *datePicker = [[UIDatePicker alloc] init]; [self.someTextField setInputView:datePicker]; class UIDatePicker : UIControl 请确保声明UIDatePi

我需要点击一个按钮,用datepicker替换已经打开的键盘!在互联网上搜索,我只找到如何使用datepicker作为文本字段的输入。还有别的办法吗?谢谢大家!

这将用UIDatePicker替换键盘:

UIDatePicker *datePicker = [[UIDatePicker alloc] init];
[self.someTextField setInputView:datePicker];
class UIDatePicker : UIControl
请确保声明UIDatePicker:

UIDatePicker *datePicker = [[UIDatePicker alloc] init];
[self.someTextField setInputView:datePicker];
class UIDatePicker : UIControl
可以查看有关UIDatePicker的更多信息的文档