开发者

Xcode universal app issue when switching view on landscape mode

I am updating an iPhone app to an universal. I have different views controller with XIB files, all is working well when navigate between this views on portrait mode, when the actual view is switching to landscape the view resize perfectly.

But when the device stay on landscape and navigate to others views (xib), the new view open show like in portrait mode and didn't resize and the view go out of the screen, and on the right part i can see a part of the last view. I think i am not using the right method to call a new view controller, looks like is created a new layer one over other.

So, is it a solution to switch views properly with auto resizing when the device is on landscape and portrait ?

More information about my project :

in my delegate :

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:[[IntroViewController alloc] initWithNibName:@"IntroViewController" bundle:nil]];
[navController setNavigationBarHidden:YES];
[window addSubview:navController.view];
[window makeKeyAndVisible];

the method to call a view :

-(IBAction)actioncontact:(id)sender{
    Contactpage *listing = [[Contactpage alloc] initWithNibName:@"Contactpage" bundle:nil];
    self.contpage = listing;
    [listing release];
    [self.view addSubview:contpage.view];
    CATransition *an开发者_如何学编程imation = [CATransition animation];
    [animation setType:kCATransitionFade];
    [animation setSubtype:kCATransitionFromRight];
    [animation setDuration:0.25];
    [[self.view layer] addAnimation:animation forKey:@"transitionViewAnimation"];
}

Thank in advance for your answers.


I found my problem the method was wrong, i used the present Modal and it works:

-(IBAction)actioncontact:(id)sender{

Contactpage *listing = [[Contactpage alloc] initWithNibName:nil bundle:nil];
listing.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:listing animated:YES];
[listing release];

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜