简体   繁体   English

iOS 8设备方向

[英]ios 8 device orientation landscape

my app's views are forced to portrait except one view (movie player) which is landscape. 我的应用程序的视图被强制为人像,但其中一个视图(电影播放器​​)为横向。 In the landscape view, I have : 在风景视图中,我有:

- (BOOL)shouldAutorotate
{
    return YES;
}

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

- (NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskLandscape;
}

the device is in landscape but the view still in portrait mode : 设备处于横向,但视图仍处于纵向模式: 在此处输入图片说明

(what you see in the simulator is what I can see in my real device) (您在模拟器中看到的就是我在真实设备中看到的)

Everything works fine for iOS prior to 8.0 8.0之前的iOS一切正常

Any idea? 任何想法?

Try to use 尝试使用

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator

for iOS 8 适用于iOS 8

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM