首页 > 其他 > 详细

UIAlertController

时间:2015-10-28 16:57:21      阅读:298      评论:0      收藏:0      [点我收藏+]

 

 
  

专题 UIAlertController

  

// iOS8之前

    // UIAlertView

    // UIActionSheet;

    

    // iOS8开始

    // UIAlertController == UIAlertView + UIActionSheet

    UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];

    

    // 添加按钮

    [alert addAction:[UIAlertAction actionWithTitle:@"收藏" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

        XMGLog(@"点击了[收藏]");

    }]];

    [alert addAction:[UIAlertAction actionWithTitle:@"举报" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

        XMGLog(@"点击了[举报]");

    }]];

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

        XMGLog(@"点击了[取消]");

    }]];

    

    [self.window.rootViewController presentViewController:alert animated:YES completion:nil];

 

 

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

UIAlertController

原文:http://www.cnblogs.com/developer-ios/p/4917759.html

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