在我的应用程序支持横向方向中,它在iOS 6中运行良好。但在iOS 7中我的设备是更改但self.view
不支持横向方向为什么?有谁像我一样面临同样的问题?那请帮帮我吧。
我的方向代码是,
#pragma mark -
#pragma mark - Interface Orientation Delegate Methods
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIDeviceOrientationLandscapeLeft)
return YES;
return NO;
}
-(BOOL) shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
我哪里错了?
答案 0 :(得分:1)
-(BOOL) shouldAutorotate
{
return YES;
}
答案 1 :(得分:0)
如果您希望应用程序支持更改方法
-(BOOL) shouldAutorotate
{
return NO;
}
到
- (BOOL)shouldAutorotate {
DebugLog(@"");
return YES;
}
答案 2 :(得分:0)
试试这种方式
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
答案 3 :(得分:0)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)) {
return NO;
} else {
return YES;
}
}