IOS 8-方向更改后,状态栏遮盖了导航栏

Shl*_*rtz 5 iphone orientation swift ios8 ytplayerview

我正在使用SWRevealViewController,并且我的应用被锁定为纵向方向。在一个视图控制器上,我正在使用来启动youtube播放器YTPlayerView。在显示视频时,我以编程方式将方向切换为横向,如下所示:

let value = UIInterfaceOrientation.LandscapeLeft.rawValue
UIDevice.currentDevice().setValue(value, forKey: "orientation")
Run Code Online (Sandbox Code Playgroud)

在退出视频时,像这样回到纵向:

let value = UIInterfaceOrientation.Portrait.rawValue
UIDevice.currentDevice().setValue(value, forKey: "orientation")
Run Code Online (Sandbox Code Playgroud)

一切正常,但是会引起布局问题:状态栏不会偏移导航栏Y,导致状态栏位于导航栏的顶部(请参见屏幕)。

改变方向之前

定向前

以横向播放视频

YouTube播放器

导航栏被状态栏遮盖

在此处输入图片说明

我在这里想念什么:)?