UIAlertController的使用二

来源:互联网 发布:淘宝网付款方式 编辑:程序博客网 时间:2024/05/22 04:54

UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:@"action选项" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

        UIAlertAction *action0 = [UIAlertActionactionWithTitle:@"选项一"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction * action) {

            [self customMethod1];

                                                        }];

        [actionSheetController addAction:action0];

        

        UIAlertAction *action = [UIAlertActionactionWithTitle:@"选项二"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction * action) {

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

                                                       }];

        UIAlertAction *action1 = [UIAlertActionactionWithTitle:@"选项三"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction * action) {

            

            [self customMethod3];

                                                        }];

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

        

        [actionSheetController addAction:action];

        [actionSheetController addAction:action1];

        [actionSheetController addAction:actionCancel];

        [actionSheetController.viewsetTintColor:[UIColorgreenColor]];

        [selfpresentViewController:actionSheetControlleranimated:YEScompletion:nil];

0 0