我视图控制器(Passwordviewcontroller),我想用 “presentModalviewController” 显示Ipad的presentModalViewController在一个视图控制器
我有一个AppDeleage:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
,这里是我的ViewController从中我想PasswordviewController到显示:
-ViewDidLoad
{
self.passwordView = [[PasswordView alloc]initWithNibName:@"PasswordView" bundle:nil];
[passwordView setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentModalViewController:passwordView animated:YES];
}
我试过一切,但它仍然不工作,有人有一个想法?
这是你的代码的精确复制/粘贴? – phi
该AppDelegate是确切的代码。 但ViewDidLoad有更多的事情要做,而不仅仅是显示modalViewController。 我的ViewController有一个视图,在该视图中是WebViews,TableViews和ImageViews。 你需要更多的信息,请问 – verklixt
是否可以'ViewDidLoad'应该是'viewDidLoad'? – phi