ios sdk6 中强制横屏显示界面的方法

ios 6.0中shouldAutorotateToInterfaceOrientation被设为deprecated ,需追加supportedInterfaceOrientations方法来响应屏幕响应

有一点要说明,在ios 6.0中supportedInterfaceOrientations设定的旋转的方向在plist的Supported interface orientations中必须存在,,必须一一对应,否则会报错,在 ios 6.0之前无论plist中是否存在,强制指定就可以,所以要先判断设备版本号,并读取plist中Supported interface orientations中支持的方向来设定旋转方向.

追加这2个方法处理。就可以在竖向设备的时候,横屏显示 view

– (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);}- (NSUInteger)supportedInterfaceOrientations {return UIInterfaceOrientationMaskLandscapeRight;}

为你的难过而快乐的是敌人,

ios sdk6 中强制横屏显示界面的方法

相关文章:

你感兴趣的文章:

标签云: