Reputation: 2099
I used the codes below to display an view(ViewController) on window.
ViewImagesController *vvViewImagesController=[[ViewImagesController alloc] init ];
self.vViewImagesController=vvViewImagesController;
[vvViewImagesController release];
UINavigationController *a=[[UINavigationController alloc]initWithRootViewController: vViewImagesController];
[self.view addSubview:a.view];
but the navigation bar appeared underneath the status bar 20 points.
Even I use the codes:
[a.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
to relocate the view, but the result is same.
Welcome any comment
Upvotes: 1
Views: 1577
Reputation: 22535
Here's what you need to do. It's 1 line and it works:
In viewDidLoad in vvViewImagesController:
[self.view setFrame: [self.view bounds]];
Whoosh!
Upvotes: 1
Reputation:
try instead
ViewImagesController *vvViewImagesController = [[ViewImagesController alloc] init];
UINavigationController *a = [[UINavigationController alloc] initWithRootViewController:vvViewImagesController];
[self presentModalViewController:a animated:YES];
[vvViewImagesController release];
[a release];
Upvotes: 0