iOS 全横屏app设置

1.设置device orientation  只要landscape(横屏)相关的属性

 

2.在AppDelegate 里添加

//设置只能显示横屏
    func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
        return  UIInterfaceOrientationMask.landscape
    }

3.到了这里 我们发现app是横屏了 但是启动页还不是横屏的

修改info 注意: 不要点击文件列表里面的info。

点击targets里面的 build setting 左边的info

然后选中你要的  Supported interface orientations    (iphone 或者ipad 根据你的需求来)里面的属性只要横屏的即可(Landscape (left home button),Landscape (right home button))

这样启动页也就横屏显示了 搞定。


版权声明:本文为huang413原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。