Ios5 如何强制视图在viewdidload中旋转到横向?
它的装载正确。这里我的问题是我的应用程序应该只在横向模式。在这里,我使用UIModalPresentationFormSheet,所以应用程序会自动以纵向模式显示。加载此登录视图后,我想强制我的应用程序更改为横向模式。有人请帮助我在加载UIModalPresentationFormSheet后如何将视图旋转到横向模式。这意味着在LoginViewController的viewDidLoad模式下,我必须强制我的应用程序更改为横向模式。我怎样才能做到这一点。提前感谢尝试使用横向坐标值重新编写用户界面框架属性 这件事在办公室里做Ios5 如何强制视图在viewdidload中旋转到横向?,ios5,uinavigationcontroller,Ios5,Uinavigationcontroller,它的装载正确。这里我的问题是我的应用程序应该只在横向模式。在这里,我使用UIModalPresentationFormSheet,所以应用程序会自动以纵向模式显示。加载此登录视图后,我想强制我的应用程序更改为横向模式。有人请帮助我在加载UIModalPresentationFormSheet后如何将视图旋转到横向模式。这意味着在LoginViewController的viewDidLoad模式下,我必须强制我的应用程序更改为横向模式。我怎样才能做到这一点。提前感谢尝试使用横向坐标值重新编写用户界
Hi I'm using following code to show my app's login screen.
LoginViewController * loginController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController:loginController];
navController.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentModalViewController:navController animated:YES];
还有附带条件
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft
|| toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)