首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >奇异位置下的UIAlertController呈现

奇异位置下的UIAlertController呈现
EN

Stack Overflow用户
提问于 2016-03-12 05:36:09
回答 1查看 57关注 0票数 1

每当我试图提出这个警告,它总是出现在某个奇怪的地方。有什么办法解决这个问题吗?

屏幕截图

代码语言:javascript
复制
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];
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-03-12 06:03:11

我想你把窗框改成了两倍宽和高,所以它显示在那里。你可以把这个记录下来看看。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35954210

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档