applicationDidBecomeActive 后加载视图
我想每次应用程序从后台启动时都显示一个 ViewController,我有这样的代码:
mainViewController *mainController = [[mainViewController alloc] init];
UIViewController *src = (UIViewController *) self.window.rootViewController;
UIViewController *dst = (UIViewController *) mainController;
[src presentModalViewController:dst animated:YES];
ViewController 加载,因为键盘弹出,但屏幕是黑色的。不管怎样谢谢你!
I want to present a ViewController every time the app starts even from background, I have this code:
mainViewController *mainController = [[mainViewController alloc] init];
UIViewController *src = (UIViewController *) self.window.rootViewController;
UIViewController *dst = (UIViewController *) mainController;
[src presentModalViewController:dst animated:YES];
The ViewController loads becuase the keyboard pops up but the screen is black. Anyway thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系,我想通了,我把我想要从主故事板加载的视图放在一个笔尖和刚刚使用的 initWithNib 中。
It's ok I figured it out, I took the View I wanted to load out of the mainstoryboard and put it in a nib and the just used initWithNib.