设置页面横竖屏

2016-06-06  本文已影响0人  GShining

// 是否支持旋转

- (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

上一篇 下一篇

猜你喜欢

热点阅读