最佳答案
有一个实现(UIAlertController),但没有图像。
这是一个工作示例:
UIAlertController* deleteAlert = [UIAlertController alertControllerWithTitle:@"Unfollow?"
message:
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction* unfollowAction = [UIAlertAction actionWithTitle:@"Unfollow" style:UIAlertActionStyleDestructive
handler:^(UIAlertAction * action) {
//Code to unfollow
}];
UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
}];
[deleteAlert addAction:unfollowAction];
[deleteAlert addAction:cancelAction];
[self presentViewController:deleteAlert animated:YES completion:nil];
您可以在这篇文章中找到有关如何将图像添加到 UIAlertController 的更多信息:
关于ios - 如何创建警报,在 iOS 上使用按钮从底部滑动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36116490/