1、通过XCode设置“iPad Deployment info”,只选择横屏左和横屏右,部署测试后并没有生效,这种方法实质是在xxx_info.plist项目配置文件中添加如下信息:UISupportedInterfaceOrientations~ipadUIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRight2、通过对每个nib文件在IB中设置orientation为landscape,此法也不生效。3、重载shouldAutorotateToInterfaceOrientation:方法,这种方式是可行的。具体如下:-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{//Return YES for supported orientationsreturn((interfaceOrientation==UIDeviceOrientationLandscapeLeft)||(interfaceOrientation==UIDeviceOrientationLandscapeRight));}如果第一种方式生效,那么比较完美。虽然第三种方式可以完全满足横屏的需求,但是实现起来比较stupid,需要在每个controller中都重载shouldAutorotateToInterfaceOrientation:方法,当然也可以通过扩展UIViewController的方式来避免重复劳动。但是感觉也有点不太直接,期待有人指出sdk本身是否就有简捷方式支持。
追问你真厉害,没太看懂,需要越狱吗?