- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试弄清楚如何在我的 iMessage 应用扩展中显示样式为 UIAlertControllerStyleActionSheet
的 UIAlertController
。
问题是,调用时显示的操作表出现在 native iMessage 文本字段下方:
[self.view.window.rootViewControllerpresentViewController:actionSheetControlleranimated:YES完成:NULL];
我该如何解决这个问题?
代码:
UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Clear", nil) message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *clear = [UIAlertAction actionWithTitle:NSLocalizedString(@"Clear", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action)
{
[self clear];
}];
UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action)
{}];
[actionSheetController addAction:clear];
[actionSheetController addAction:cancel];
[self.view.window.rootViewController presentViewController:actionSheetController animated:YES completion:NULL];
最佳答案
这里有一个解决方法。也许添加一点动画以使其平滑。
[self.view.window.rootViewController presentViewController:actionSheetController animated:YES completion:^{
actionSheetController.view.frame = CGRectOffset(actionSheetController.view.frame, 0, -40);
}];
关于ios - 从 MSMessagesAppViewController 正确呈现 UIAlertController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40160881/
我正在 swift3 中为 i 消息应用程序实现贴纸包应用程序 我的代码是这样的 func loadStickers() { for i in 1...6 { if let
问题 在 iOS 10.2 上 didSelect() 仅在第一次选择消息时调用,但不会在第二次选择同一消息时调用(在第一次选择发生后)。例如: 在我的消息应用程序处于事件状态时单击收到的 MSMes
我创建了一个 iMessage 应用程序来发送从图像转换而来的 MSSticker。 我已经实现了以下重写方法: override func didStartSending(_ message: MS
我正在尝试弄清楚如何在我的 iMessage 应用扩展中显示样式为 UIAlertControllerStyleActionSheet 的 UIAlertController。 问题是,调用时显示的操
当我的 MSMessagesAppViewController 将presentationStyle从 compact 更改时至expanded并返回compact ,我的 UITableView 的
我正在尝试弄清楚如何在我的 iMessage 应用程序扩展中显示样式为 UIAlertControllerStyleActionSheet 的 UIAlertController。 问题是,操作表在调
我正在创建一个 iMessage 扩展程序,其中对于扩展的演示文稿样式,我想使用 UINavigationController。我正在尝试使用以下函数将导航 Controller 添加为 MSMess
我有一个新的 iMessage 扩展项目,我在其中尝试了 2 种构建导航堆栈的方法: 在我的 Storyboard 中,我将入口点设置为 UINavigationController,它以我的 MSM
我是一名优秀的程序员,十分优秀!