标签:style io ar color os sp for strong on
2种方法
应用级别控制
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
returnUIInterfaceOrientationMaskAll;
}
视图控制器控制
//iOS 6-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
if (toInterfaceOrientation ==UIInterfaceOrientationLandscapeLeft | toInterfaceOrientation ==UIInterfaceOrientationLandscapeRight)
{
return YES;
}
else
{
return NO;
}
}
//iOS 6+
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
// return UIInterfaceOrientationMaskLandscape;
returnUIInterfaceOrientationMaskAll;
}
注意:
如果控制器的父控制器为导航控制器或TabBar控制器,要在导航控制器或者TabBar控制器修改在导航控制器或者Tab控制器的子控制器修改是没效的。
标签:style io ar color os sp for strong on
原文地址:http://blog.csdn.net/isharestudio/article/details/41774893