您的位置:首页 > 产品设计 > UI/UE

UIAlertAction 弹出对话框9.0后有点变化

2015-12-02 11:54 375 查看
ios 9.0后再用以前的UIAlertAction 已经不行了 被弃用了 改用这种方法了
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示"message:@"什么怎么怎么样"preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSLog(@"点击取消按钮执行");
}];

UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSLog(@"点击确定按钮执行");
}];
[alertController addAction:cancelAction];
[alertController addAction:otherAction];
[self presentViewController:alertController animated:YES completion:nil];
对里面的确定 取消按钮 执行方法 简单 直白
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: