弹窗

作者: iOS乐乐 | 来源:发表于2020-06-20 23:09 被阅读0次
    #pragma mark-从底部到上的弹窗
    -(void)alertAction{
        WS(weakSelf)
        //创建提示框控制器
        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
        //创建提示按钮
        UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        }];
        UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"支付宝" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            [weakSelf.TFArr replaceObjectAtIndex:0 withObject:@"支付宝"];
            [weakSelf.myTableView reloadData];
        }];
        UIAlertAction *action3 = [UIAlertAction actionWithTitle:@"微信" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            [weakSelf.TFArr replaceObjectAtIndex:0 withObject:@"微信"];
            [weakSelf.myTableView reloadData];
        }];
        UIAlertAction *action4 = [UIAlertAction actionWithTitle:@"银联支付" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            [weakSelf.TFArr replaceObjectAtIndex:0 withObject:@"银联支付"];
            [weakSelf.myTableView reloadData];
        }];
        //添加提示按钮
        [alertController addAction:action1];
        [alertController addAction:action2];
        [alertController addAction:action3];
        [alertController addAction:action4];
        [self presentViewController:alertController animated:YES completion:nil];
    }
    

    相关文章

      网友评论

          本文标题:弹窗

          本文链接:https://www.haomeiwen.com/subject/pysnxktx.html