SPStore / SPAlertController

提醒对话框,风格和微信原生几乎零误差。简书地址:
https://www.jianshu.com/p/f55b98c352a7
MIT License
430 stars 68 forks source link

使用alertControllerWithTitle初始化title和message都为空的情况下,不能弹出弹窗 #44

Open xiruoruo opened 3 years ago

xiruoruo commented 3 years ago

调试发现此时alertController的view高度为0,导致各子view都无法显示出来。

SPAlertController *alertController = [SPAlertController alertControllerWithTitle:nil message:nil preferredStyle:SPAlertControllerStyleActionSheet];
alertController.needDialogBlur = YES;

    SPAlertAction *actionQuit = [SPAlertAction actionWithTitle:CMString(@"自己", nil) style:SPAlertActionStyleDefault handler:^(SPAlertAction * _Nonnull action) {
    }];
    [alertController addAction:actionQuit];

    SPAlertAction *actionKill = [SPAlertAction actionWithTitle:CMString(@"他人", nil) style:SPAlertActionStyleDestructive handler:^(SPAlertAction * _Nonnull action) {
    }];
    [alertController addAction:actionKill];

SPAlertAction *actionCancel = [SPAlertAction actionWithTitle:CMString(@"取消", nil) style:SPAlertActionStyleCancel handler:^(SPAlertAction * _Nonnull action) {
}];
[alertController addAction:actionCancel];

[self presentViewController:alertController animated:YES completion:^{}];
xiruoruo commented 3 years ago

现象与https://github.com/SPStore/SPAlertController/issues/34 相同