ModalViewController 仅在动画时显示
在我的应用程序委托中,我想显示应用程序首次启动的注册屏幕。
这是我的代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window.rootViewController = self.tabBarController;
[[[self.tabBarController.tabBar items] objectAtIndex:2] setEnabled:NO];
[[[self.tabBarController.tabBar items] objectAtIndex:3] setEnabled:NO];
if (![self checkAuth]) {
SignupViewController * signUp = [[SignupViewController alloc] initWithNibName:@"SignupView" bundle:nil] ;
[signUp setManagedObjectContext:self.managedObjectContext];
[[self tabBarController] presentModalViewController:signUp animated:YES] ;
[signUp release] ;
}
[self.window makeKeyAndVisible];
return YES;}
一切正常,但我不希望我的 modalViewController 动画...
当我更改行时:
[[self tabBarController] presentModalViewController:signUp animated:YES] ;
for:
[[self tabBarController] presentModalViewController:signUp animated:NO] ;
显示我的底层 tabBarController 而我的 modalViewController 没有出现!
我花了很多时间搜索有类似问题的人,但没有找到任何解决方案...
有人可以帮助我吗?
In my app delegate, I want to display a Sign Up Screen for application first start.
Here is my code :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window.rootViewController = self.tabBarController;
[[[self.tabBarController.tabBar items] objectAtIndex:2] setEnabled:NO];
[[[self.tabBarController.tabBar items] objectAtIndex:3] setEnabled:NO];
if (![self checkAuth]) {
SignupViewController * signUp = [[SignupViewController alloc] initWithNibName:@"SignupView" bundle:nil] ;
[signUp setManagedObjectContext:self.managedObjectContext];
[[self tabBarController] presentModalViewController:signUp animated:YES] ;
[signUp release] ;
}
[self.window makeKeyAndVisible];
return YES;}
Everything works fine, but I don't want my modalViewController to be animated...
When I change the line :
[[self tabBarController] presentModalViewController:signUp animated:YES] ;
for :
[[self tabBarController] presentModalViewController:signUp animated:NO] ;
My underlying tabBarController is displayed and my modalViewController does not appear !
I spent a lot of time to search someone with a similar problem, but I didn't found any solution...
Someone can help me please ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在presentModalViewController之前调用
[self.window makeKeyAndVisible];
。Try to call
[self.window makeKeyAndVisible];
before presentModalViewController.