ios模拟器的方向设置

来源:互联网 发布:如何当好淘宝客服? 编辑:程序博客网 时间:2024/05/19 17:52

1,support files --------->Rotation-Info.plist--------->supported interface orientations--------->修改Item0的值 (Item0的值就是默认启动模拟器时的方向),这样设置后,在其后的所有的界面中默认的模拟器方向就是这个Item0的值了。


2,在其后的界面中可以通过如下代码修改模拟器的方向:

       方法1>

[[UIDevicecurrentDevice]performSelector:@selector(setOrientation:)withObject:(id)UIInterfaceOrientationPortrait];

       方法2>

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];


本人新手,对这个ios也不了解,有什么不对的地方,欢迎各位大神指出来。

原创粉丝点击