游戏是横屏的,需要默认横屏
但是银联需要支持竖屏,所以需要支持竖屏。
首先在 general 里面设置 Device Orientation 勾选 Portrait 支持竖屏
然后在根 controller 里面写上这样的代码支持默认横屏
//强制横屏 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation NS_DEPRECATED_IOS(2_0, 6_0){ return UIInterfaceOrientationIsLandscape(interfaceOrientation); } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } - (BOOL)shouldAutorotate { return YES; }
判断系统还可以用这个方法
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) if(SYSTEM_VERSION_LESS_THAN(@"8.0")) { }
版权属于:东哥笔记 - DongGe.org
本文链接:http://dongge.org/blog/168.html
本文采用知识共享署名4.0 国际许可协议进行许可。转载或大段使用必须添加本文链接,否则您将构成侵权!