我正在为我的应用程序实现一个共享扩展,到目前为止一切都很好,除了我似乎无法关闭使用默认布局/故事板自动打开的键盘。
我保持默认设计/布局(SLComposeServiceViewController),其中包括预览图像和 UITextview,UITextview 自动获得焦点,打开键盘。
通常这很好,但如果你没有登录我的应用程序,我会显示一个 UIAlertController 说你需要登录才能共享。问题是键盘在警报的同时打开。
我已经尝试过在 viewDidLoad、viewDidAppear 和 viewWillAppear 中都没有运气[self.view endEditing:YES];
。[self.textView resignFirstResponder];