【发布时间】:2011-07-08 11:01:44
【问题描述】:
我在横向模式下呈现 UINavigationViewController 时遇到问题。视图会自动旋转到纵向模式。我已经花了大约 3 个小时来解决这个问题。如果我没有导航控制器,它工作正常。但是,我需要导航控制器,因为我必须从中推送另一个视图控制器。
请提出任何解决问题的建议。这是代码。
SharingViewController *sharingViewController = [[SharingViewController alloc] initWithNibName:@"SharingViewController" bundle:nil];
UINavigationController *navi = [[[UINavigationController alloc] initWithRootViewController:sharingViewController] autorelease];
[navi setWantsFullScreenLayout:YES];
[navi.view setAutoresizesSubviews:NO];
[navi.navigationBar setHidden:YES];
navi.view.autoresizingMask = UIViewAutoresizingFlexibleWidth;
navi.visibleViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:navi animated:YES];
【问题讨论】:
标签: ipad uinavigationcontroller landscape