ios 8设备定位环境

时间:2014-10-06 13:41:57

标签: objective-c iphone ios8 orientation

我的应用程序的视图被强制为纵向,但一个视图(电影播放器​​)是风景。 在横向视图中,我有:

- (BOOL)shouldAutorotate
{
    return YES;
}

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

- (NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskLandscape;
}

设备处于横向状态,但视图仍处于纵向模式:enter image description here

(你在模拟器中看到的是我在真实设备中可以看到的)

一切适用于8.0之前的iOS

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试使用

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
适用于iOS 8的