码迷,mamicode.com
首页 > 其他好文 > 详细

UIAlertController

时间:2016-03-31 23:29:19      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

    UIAlertController * alert =[UIAlertController alertControllerWithTitle:@"新建相册" message:@"请输入新建相册的名字" preferredStyle:UIAlertControllerStyleAlert];

    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

    }];

    

    UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

    }];

    

    [alert addAction:cancelAction];

    [alert addAction:otherAction];

    [alert addTextFieldWithConfigurationHandler:nil];

 

    [self presentViewController:alert animated:YES completion:nil];

 

技术分享

 

    UIAlertController * alert =[UIAlertController alertControllerWithTitle:@"选择方式" message:@"" preferredStyle:UIAlertControllerStyleActionSheet];

 

    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

    }];     

    UIAlertAction *photoLibraryAction = [UIAlertAction actionWithTitle:@"从相册读取" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

    }];

    UIAlertAction *takePhotoAction = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

    }];

 

    [alert addAction:cancelAction];

    [alert addAction:takePhotoAction];

    [alert addAction:photoLibraryAction];

    

    [self presentViewController:alert animated:YES completion:nil];

UIAlertController

标签:

原文地址:http://www.cnblogs.com/damonWq/p/5342976.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!