UIAlertController в странном месте
Всякий раз, когда я пытаюсь представить это предупреждение, оно появляется в каком-то странном месте. Есть идеи, как это исправить?
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Logout"
message:@"Are you sure you want to logout?"
preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"Yes"
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction * _Nonnull action) {
[[NSUserDefaults standardUserDefaults] setBool:@"NO" forKey:@"auth"];
[(AppDelegate *)[UIApplication sharedApplication].delegate changeRootViewController:[Login sharedLogin]];
}]];
[alert addAction:[UIAlertAction actionWithTitle:@"No"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * _Nonnull action) {
[alert dismissViewControllerAnimated:YES completion:nil];
}]];
[self presentViewController:alert animated:YES completion:nil];
1 ответ
Решение
Я думаю, что вы изменили оконную раму, чтобы удвоить ширину и высоту, чтобы она показалась там. Вы можете войти, чтобы проверить.