keyWindowにUIViewを追加すると、alertControllerはviewによってカバーされます。ここにコードがあります。UIAlertControllerはウィンドウのビューでカバーされています
- (void)touch {
UIWindow *currentWindow = [UIApplication sharedApplication].keyWindow;
UIView *viewhaha = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
viewhaha.backgroundColor = [UIColor redColor];
[currentWindow addSubview:viewhaha];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"123" message:@"123" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"123" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
[alertController addAction:action1];
[self presentViewController:alertController animated:YES completion:^{
}];
}
ここに画像があります。 Image
解決方法をご存知ですか?