UIAlertController * alertControl = [UIAlertController alertControllerWithTitle:@"注意" message:@"我们有两种方式接收您的宝贵意见哦" preferredStyle:UIAlertControllerStyleAlert];
[alertControl addAction:[UIAlertAction actionWithTitle:@"联系我们" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}]];
[alertControl addAction:[UIAlertAction actionWithTitle:@"去AppStore" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}]];
[alertControl addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
}]];
[self presentViewController:alertControl animated:YES completion:nil];iOS UIAlertController 的常用方法
最新推荐文章于 2023-08-17 14:22:52 发布
本文提供了一个使用 UIAlertController 创建并显示带有三个按钮(联系我们、去AppStore 和取消)的警告框的示例代码。通过设置不同的样式和处理器,展示了如何响应用户的操作。
2128

被折叠的 条评论
为什么被折叠?



