iPhone/iPad 屏幕旋屏 iphone / ipod deployment info 调整

发布时间:2020-04-09 01:40:08 作者:杜甲同学
来源:网络 阅读:64

一般新建一个ViewController都会默认有以下这个函数

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;



下面我们来定义各种旋转

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

return (interfaceOrientation == UIInterfaceOrientationPortrait); //只支持竖屏

//return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);  //除了倒置,其他方向都支持

//return (interfaceOrientation == UIDeviceOrientationLandscapeRight); //只支持向右横屏

//return (interfaceOrientation == UIDeviceOrientationLandscapeLeft);  //只支持向左横屏

}


如果不重写这个函数(也就是把这个函数完全注释),默认是只支持竖屏幕。





如果要在xib视图变成横屏,需要在Simulated Metrics的Orientation设置为Landscape。

iPhone/iPad 屏幕旋屏  iphone / ipod deployment info 调整




如果让程序一启动就是横屏显示,就要在工程设置里的Summary的iPhone/iPod Deployment Info 改变 Supported Device Orientations 的选项

iPhone/iPad 屏幕旋屏  iphone / ipod deployment info 调整


推荐阅读:
  1. iOS如何开发入门
  2. iOS给border设置渐变色的案例

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ios iphone ipod

上一篇:MySQL授权用户及密码恢复设置

下一篇:思科ASA部署Failover(Active/Standby)

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》