UIAlertController

来源:互联网 发布:网络安全法的立法定位 编辑:程序博客网 时间:2024/05/23 05:08

看一下如何实现下面的效果
UIAlertController

 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"操作提示" message:@"真的要注销吗?" preferredStyle:UIAlertControllerStyleActionSheet];    UIAlertAction *tem1 = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {        [self.navigationController popViewControllerAnimated:YES];    }];    UIAlertAction *tem2 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];    [alert addAction:tem1];    [alert addAction:tem2];    [self.navigationController presentViewController:alert animated:YES completion:nil];

就这么easy

1 0