我想在景观中强行显示一个视图。 所有其他观点都是纵向的。
我尝试使用以下代码在纵向模式下显示横向模式。它不起作用。
我该怎么做?
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ((interfaceOrientation == UIInterfaceOrientationMaskLandscape) ||
(interfaceOrientation == UIInterfaceOrientationMaskLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationMaskLandscapeRight))
{
return YES;
}
return NO;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
-(BOOL)shouldAutorotate{
return NO;
}
-(NSInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}