Ios 目标C:行动表驳回键盘?

Ios 目标C:行动表驳回键盘?,ios,objective-c,Ios,Objective C,在我的应用程序中,我有一个聊天界面,带有一个简单的UITextView作为文本输入 UITextView作为第一响应程序,键盘可见,我向用户展示以下操作表,并提供一些选项。但是,当提交操作表时,键盘将被关闭,textview将作为第一响应者退出。如何编辑此行为以在显示操作表时保持键盘可见 UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredSty

在我的应用程序中,我有一个聊天界面,带有一个简单的UITextView作为文本输入

UITextView作为第一响应程序,键盘可见,我向用户展示以下操作表,并提供一些选项。但是,当提交操作表时,键盘将被关闭,textview将作为第一响应者退出。如何编辑此行为以在显示操作表时保持键盘可见

UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];

[actionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"copy", @"") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

// copy text

}]];

[actionSheet setModalPresentationStyle:UIModalPresentationPopover];

UIPopoverPresentationController *popPresenter = [actionSheet popoverPresentationController];
popPresenter.sourceView = self.optionsButton;
popPresenter.sourceRect = self.optionsButton.bounds;

[self presentViewController:actionSheet animated:YES completion:nil];

您必须更改UIAlertController,因为UIAlertController只是一个ViewController,您可以将其显示为这一正常行为,因此请尝试将自定义操作表创建为UIViewController为什么只显示一个“复制”操作的
UIAlertController
?你好像是用按钮来演示的?行动表的好处是什么?