发现 b2c交易在ios6上webview随屏幕旋转了,可是b2c支持横屏的,缘由是ios6的委托 ios
iOS6下的 web
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation} app
b2c交易只支持横屏,网银交易须要支持横竖屏,因此若是在info.plist设置支持的方向,则再同以客户端下两种应用有冲突。解决这个问题的方法就是再前面的基础上再应用的delegate中加入以下回调:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (clientstate == 0) /* 网银*/
return UIInterfaceOrientationMaskAll;
else/* b2c*/
return UIInterfaceOrientationMaskLandscape;
} ide
简单说明: spa
UIInterfaceOrientationMaskLandscape 支持左右横屏
UIInterfaceOrientationMaskAll 支持四个方向旋转
UIInterfaceOrientationMaskAllButUpsideDown 支持除了UpsideDown之外的旋转 webview