国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 青龙| 彭山县| 紫金县| 江阴市| 汝阳县| 和静县| 东宁县| 赤壁市| 门头沟区| 咸阳市| 墨竹工卡县| 南丹县| 中西区| 铜山县| 惠州市| 南皮县| 九龙县| 哈尔滨市| 连南| 松阳县| 庐江县| 厦门市| 北流市| 平罗县| 新宁县| 太湖县| 嵊泗县| 灌云县| 遵化市| 和顺县| 三都| 六安市| 曲周县| 喀喇| 卢氏县| 墨江| 长春市| 岳西县| 珲春市| 宝应县| 阿瓦提县|