UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"确定要退出登录吗?" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *alertT = [UIAlertAction actionWithTitle:@"退出登录" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击退出登录");
}];
UIAlertAction *alertF = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击了取消");
}];
[actionSheet addAction:alertT];
[actionSheet addAction:alertF];
[self presentViewController:actionSheet animated:YES completion:nil];
iOS UIAlertController
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
相关阅读更多精彩内容
- 参考文档:https://developer.apple.com/reference/uikit/uialertc...
- 1.中间弹出效果: UIAlertController *alert = [UIAlertController a...
- 答:废话不多说直接上代码。如下所示: /* 类方法快速创建一个提示控制器 值得注意的是这个控制器有个preferr...
- UIAlertControlle有两种preferredStyle 1.UIAlertControllerStyl...
- 这个是最新的提示框的使用 ,用以前的方法 总是报⚠️ 所以 就用这个了 //创建sheet提示框,提示选择相机还是...