ios7(自动旋屏)iOS6不支持shouldAutorotateToInterfaceOrientation
2013-10-23 23:57
459 查看
参考开源中国——双子座教程ios7
/article/3457421.html
发现 b2c交易在ios6上webview随屏幕旋转了,但是b2c支持横屏的,原因是ios6的委托
iOS6下的
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return
UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
这个不会再被调用,取而代之的是这俩个组合:
- (BOOL)shouldAutorotate
{
return
YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return
UIInterfaceOrientationMaskLandscape;
}
当然,为了保持对旧版本系统行为的兼容性,不要删掉不用的那个调用。另外还有一个这个preferred朝向也可以加上
-
(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return
UIInterfaceOrientationLandscapeRight;
}
b2c交易只支持横屏,网银交易需要支持横竖屏,所以如果在info.plist设置支持的方向,则再同以客户端下两种应用有冲突。解决这个问题的方法就是再前面的基础上再应用的delegate中加入如下回调:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (clientstate == 0)
return UIInterfaceOrientationMaskAll;
else
return UIInterfaceOrientationMaskLandscape;
}
简单说明:
UIInterfaceOrientationMaskLandscape 支持左右横屏
UIInterfaceOrientationMaskAll 支持四个方向旋转
UIInterfaceOrientationMaskAllButUpsideDown 支持除了UpsideDown以外的旋转
/article/3457421.html
发现 b2c交易在ios6上webview随屏幕旋转了,但是b2c支持横屏的,原因是ios6的委托
iOS6下的
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return
UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
这个不会再被调用,取而代之的是这俩个组合:
- (BOOL)shouldAutorotate
{
return
YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return
UIInterfaceOrientationMaskLandscape;
}
当然,为了保持对旧版本系统行为的兼容性,不要删掉不用的那个调用。另外还有一个这个preferred朝向也可以加上
-
(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return
UIInterfaceOrientationLandscapeRight;
}
b2c交易只支持横屏,网银交易需要支持横竖屏,所以如果在info.plist设置支持的方向,则再同以客户端下两种应用有冲突。解决这个问题的方法就是再前面的基础上再应用的delegate中加入如下回调:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (clientstate == 0)
return UIInterfaceOrientationMaskAll;
else
return UIInterfaceOrientationMaskLandscape;
}
简单说明:
UIInterfaceOrientationMaskLandscape 支持左右横屏
UIInterfaceOrientationMaskAll 支持四个方向旋转
UIInterfaceOrientationMaskAllButUpsideDown 支持除了UpsideDown以外的旋转
相关文章推荐
- 转:ios7(自动旋屏)iOS6不支持shouldAutorotateToInterfaceOrientation
- iOS6不支持shouldAutorotateToInterfaceOrientation
- 问题解决:iOS6下shouldAutorotateToInterfaceOrientation不起作用,屏幕旋转同时支持iOS5和iOS6
- 问题解决:iOS6下shouldAutorotateToInterfaceOrientation不起作用,屏幕旋转同时支持iOS5和iOS6
- iOS6不支持shouldAutorotateToInterfaceOrientation
- addSubview导致的旋屏问题:shouldAutorotateToInterfaceOrientation方法不调用
- iOS6对于shouldAutorotateToInterfaceOrientation的改动以及其他一些窗口相关细节
- iOS6对于shouldAutorotateToInterfaceOrientation的改动以及其他一些窗口相关细节
- iOS6对于shouldAutorotateToInterfaceOrientation的改动以及其他一些窗口相关细节
- 强行触发shouldAutorotateToInterfaceOrientation
- 转:ios7(自动旋屏)iOS6不支持shou…
- shouldAutorotateToInterfaceOrientation 不触发或者不执行的问题
- 横屏与竖屏shouldAutorotateToInterfaceOrientation
- shouldAutorotateToInterfaceOrientation 不触发或者不执行的问题 转载
- shouldAutorotateToInterfaceOrientation 不触发或者不执行的问题
- shouldAutorotateToInterfaceOrientation
- shouldAutorotateToInterfaceOrientation 不触发或者不执行的问题 及旋转过程中各方法的作用
- 转:ios7(自动旋屏)iOS6不支…
- 转:ios7(自动旋屏)iOS6不支…
- 转:ios7(自动旋屏)iOS6不支…