您的位置:首页 > 移动开发 > IOS开发

iOS9 alert问题

2015-10-10 10:51 609 查看
iOS9之后alertview不让用啦,用UIAlertController吧

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"警告" message:@"xxxxxxx" preferredStyle:UIAlertControllerStyleAlert];

[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

}]];
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

}]];
[self presentViewController:alert animated:YES completion:^{
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self dismissViewControllerAnimated:YES completion:nil];
// });
}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: