是否可以使presentModalViewController成为UINavigation控制器?
我试图在应用程序启动时出现一个presentModalViewController。我可以使presentModalViewController 正常显示,但是当我尝试将其设为UINavigation Controller 时,我看到的只是一个空白的UINavigationController。
我的类 Overview 定义如下:
#import <UIKit/UIKit.h>
@class Login;
@interface Overview : UINavigationController {
}
-(IBAction) btnRegistrationPressed;
-(IBAction) btnLoginPressed;
@end
然后在委托中我这样做:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the tab bar controller's view to the window and display.
[self.window addSubview:tabBarController.view];
Overview *overviewViewController = [[Overview alloc] initWithNibName:@"Overview" bundle:nil];
[self.tabBarController presentModalViewController:overviewViewController animated:YES];
[overviewViewController release];
[self.window makeKeyAndVisible];
return YES;
}
我还有一个 Overview.xib,其中我从库中拖入了 UiNavigation Controller。下面的视图控制器被设置为一个名为 test 的类,它将在屏幕上显示一条消息。
当我启动时,我看到的只是一个空白的 UINavigationController。
有什么想法吗?
I am trying to make a presentModalViewController come up upon launch of the app. I can make the presentModalViewController come up fine but when I try to make it a UINavigation Controller, All I see is a blank UINavigationController.
My class Overview is defined as follows:
#import <UIKit/UIKit.h>
@class Login;
@interface Overview : UINavigationController {
}
-(IBAction) btnRegistrationPressed;
-(IBAction) btnLoginPressed;
@end
Then in delegate I am doing this:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the tab bar controller's view to the window and display.
[self.window addSubview:tabBarController.view];
Overview *overviewViewController = [[Overview alloc] initWithNibName:@"Overview" bundle:nil];
[self.tabBarController presentModalViewController:overviewViewController animated:YES];
[overviewViewController release];
[self.window makeKeyAndVisible];
return YES;
}
I also have a Overview.xib in which I dragged in a UiNavigation Controller from library. The view controller underneath that is set to a class called test that would show a message on screen.
When I launch, all I see is a blank UINavigationController.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你有没有尝试过像下面这样
}
Have you tried like following
}