屏幕旋转自动问题

来源:互联网 发布:简单爱 知乎 编辑:程序博客网 时间:2024/05/05 18:53

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation ==UIInterfaceOrientationPortrait);
}

如果返回的是(interfaceOrientation == UIInterfaceOrientationPortrait)表示只支持home键在最下面的那个方向
((interfaceOrientation == UIInterfaceOrientation) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft))表示支持home键在下面和在左边的两个方向,以此类推

原创粉丝点击