Iphone 在ios 6上仅在一个视图中启用横向定向
我只想在我的应用程序的一个视图中启用横向定位。其他视图必须仅支持纵向模式。但对于iOS 6,即使我使用的是iOS 6的最新方法,它也会自动旋转。期待正确的建议。对于仅纵向定位,请尝试以下方法Iphone 在ios 6上仅在一个视图中启用横向定向,iphone,ios,ios5,ios6,Iphone,Ios,Ios5,Ios6,我只想在我的应用程序的一个视图中启用横向定位。其他视图必须仅支持纵向模式。但对于iOS 6,即使我使用的是iOS 6的最新方法,它也会自动旋转。期待正确的建议。对于仅纵向定位,请尝试以下方法 -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -(BOOL)shouldAutorotate { return NO; } 查看此
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
-(BOOL)shouldAutorotate
{
return NO;
}
查看此链接,谢谢。。但在链接中使用的方法仍然是支持方向。除了一个支持两个横向和纵向的视图外,我想要纵向。不,它只是不起作用。。我早就试过了。。主要问题在iOS 6中。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
- (BOOL)shouldAutorotate {
return FALSE;
}