0

我有标签栏应用程序,我想旋转 Portrait & PortraitUpsideDown。我所有其他选项卡都可以并已旋转。唯一的区别是view也设计了xib。

这是我为支持方向而实现的代码。正如我之前提到的 - 我所有其他选项卡都在工作和旋转。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}

- (BOOL)shouldAutorotate {
    return [self shouldAutorotateToInterfaceOrientation:self.interfaceOrientation];
}

    - (void)viewDidLoad{
        self.view.autoresizesSubviews = YES;
        self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

        [super viewDidLoad];

        // Do any additional setup after loading the view from its nib.
}

我的应用支持 4.3+ IOS。请帮我修复它 - 我必须尽快将它发送给苹果......

4

1 回答 1

0

我修复了它,问题是我用自定义init方法分配了我的视图控制器,我忘了加载self = [super init...] 内部。

好。希望这对将来的人有所帮助!

于 2012-12-10T01:54:32.333 回答