国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

UIAlertController的用法

2019-11-09 18:51:17
字體:
供稿:網(wǎng)友

ios8不用于以前,uiAlertController屬于UIViewController,而以前UIAlertView是屬于UIView的。 

//添加對(duì)話提示框

        UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:@"提示" message:@"請選擇”"PReferredStyle:UIAlertControllerStyleAlert];

        UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"確定"style:UIAlertActionStyleDestructivehandler:^(UIAlertAction * action) {}];

        [actionSheetController addAction:actionCancel];

        [actionSheetController.view setTintColor:[UIColor redColor]];

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

用法二---多選項(xiàng)

UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:@"action選項(xiàng)" message:nilpreferredStyle:UIAlertControllerStyleActionSheet];

        UIAlertAction *action0 = [UIAlertAction actionWithTitle:@"選項(xiàng)一" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

            [self customMethod1];

                                                        }];

        [actionSheetController addAction:action0];

        

        UIAlertAction *action = [UIAlertAction actionWithTitle:@"選項(xiàng)二" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

        [self <span style="font-family: Arial, Helvetica, sans-serif;">customMethod2</span>];

                                                       }];

        UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"選項(xiàng)三" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

            

            [self customMethod3];

                                                        }];

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

        

        [actionSheetController addAction:action];

        [actionSheetController addAction:action1];

        [actionSheetController addAction:actionCancel];

        [actionSheetController.view setTintColor:[UIColor greenColor]];

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


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 开封市| 丰顺县| 长汀县| 宁波市| 贵州省| 芮城县| 北辰区| 乌拉特后旗| 客服| 定兴县| 海阳市| 龙州县| 天等县| 芜湖市| 红河县| 酒泉市| 西平县| 连州市| 洪洞县| 阳江市| 荔波县| 辉县市| 广河县| 桐庐县| 宁德市| 安溪县| 元阳县| 九龙县| 镇安县| 花莲市| 垣曲县| 凤翔县| 东兴市| 高淳县| 额敏县| 贡觉县| 科技| 襄汾县| 伽师县| 岳阳县| 咸丰县|