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

《iOS开发笔记—UIAlertController》

2016-09-06 14:40 281 查看
UIAlertController介绍

UIAlertController是iOS8推出的新概念,取代了之前的
UIAlertView和UIActionSheet,使用方法如下:

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"这是标题啊标题-标题"
message:@"这是消息啊消息-消息"
preferredStyle:UIAlertControllerStyleAlert ];
//取消style:UIAlertActionStyleDefault
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:cancelAction];
UIAlertAction *rubbishAction = [UIAlertAction actionWithTitle:@"简直废话" style:UIAlertActionStyleDestructive handler:nil];
[alertController addAction:rubbishAction];
[self presentViewController:alertController animated:YES completion:nil];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: