在ios 7中发布相关的横向视图?

时间:2014-01-23 13:16:25

标签: ios iphone objective-c

在我的应用程序支持横向方向中,它在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;
}

我哪里错了?

4 个答案:

答案 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;
    }
}