在iOS 14中以编程方式打开UIDatePicker [英] Open UIDatePicker programmatically in iOS 14

查看:156
本文介绍了在iOS 14中以编程方式打开UIDatePicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个普通的UIDatePicker(很抱歉,它不是英语的,请忽略它):

I have this normal UIDatePicker (sorry that it's not in English, please ignore that):

但是问题在于它仅在我按下日期选择器时出现:

But the problem is that it only appears when I'm pressing the Date Picker:

我想知道如何在第一张图像中显示日期选择器(它具有模糊效果覆盖了整个屏幕)仅使用代码,因此用户不需要按日期选择器以显示日期选择器.谢谢.

And I wanted to know how to show the Date Picker like in the first image (that it's covering all the screen with the blur effect) only with code, so the user won't need to press the Date Picker to show the date selector. Thanks.

推荐答案

不可能在代码中用UIKit14打开UIDatePicker

It's impossible to open a UIDatePicker with UIKit14 from within the code

  • UIDatePicker没有用于执行此操作的API
  • UIKit不允许我们创建对UIKit有任何影响的UIEventsUITouch对象.
  • UIDatePicker has no API for doing this
  • UIKit doesn't allow us to create a UIEvents or UITouch object which has any impact on UIKit.

这篇关于在iOS 14中以编程方式打开UIDatePicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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