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

首頁 > 學院 > 開發設計 > 正文

UIAlertController的用法

2019-11-09 17:55:10
字體:
來源:轉載
供稿:網友

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

//添加對話提示框

        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];

用法二---多選項

UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:@"action選項" message:nilpreferredStyle:UIAlertControllerStyleActionSheet];

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

            [self customMethod1];

                                                        }];

        [actionSheetController addAction:action0];

        

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

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

                                                       }];

        UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"選項三" 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];


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 石狮市| 东乡族自治县| 奈曼旗| 盐亭县| 沐川县| 新田县| 朔州市| 会理县| 郴州市| 庄河市| 同心县| 洞头县| 雷山县| 兰溪市| 乐陵市| 凌源市| 休宁县| 鲁甸县| 南城县| 通山县| 蓬安县| 武汉市| 偏关县| 乌拉特后旗| 静宁县| 交城县| 晋州市| 枝江市| 陈巴尔虎旗| 綦江县| 邛崃市| 尼勒克县| 什邡市| 望江县| 岚皋县| 萨嘎县| 安顺市| 和龙市| 定安县| 阳山县| 德阳市|