首页 > 其他 > 详细

UIAlertController

时间:2016-06-08 18:37:51      阅读:119      评论:0      收藏:0      [点我收藏+]

UIAlertView iOS9.0之后注销了,简单介绍一下UIAlertController的使用:

 //提醒控制器类型有两种UIAlertControllerStyleActionSheet和UIAlertControllerStyleAlert
  UIAlertController *alertC=[UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleActionSheet];  
 //
  UIAlertController *alert=[UIAlertController alertControllerWithTitle:@"title" message:@"message" preferredStyle:UIAlertControllerStyleAlert];
   
 //
  UIAlertAction *cancel=[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
        
    }];

 //添加动作
    [alert addAction:cancel];
 //添加textfield
    [alert addTextFieldWithConfigurationHandler:^(UITextField *text){
        
    }];
 //展示提醒控制器
    [self presentViewController:alert animated:YES completion:nil];

 

UIAlertController

原文:http://www.cnblogs.com/sunjianfei/p/5570853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!