// 是否支持旋转
- (BOOL)shouldAutorotate
{
return NO;
}
// 旋转方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);//
如果返回的是(interfaceOrientation == UIInterfaceOrientationPortrait)表示只支持home键在最下面的那个方向
((interfaceOrientation == UIInterfaceOrientation) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft))表示支持home键在下面和在左边的两个方向,以此类推。。。
}
参考:http://blog.csdn.net/jpcfei/article/details/8995531
网友评论