this class is not key value coding-compliant for the key
ios5里面的旋转方法ios6里面确实掉不到了,但是还是可以用的。
首先,在app的主界面(也就是自己的主ViewController.m)里面加上
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;//这里返回哪个值,就看你想支持那几个方向了。这里必须和后面plist文件里面的一致(我感觉是这样的)。
}
- (BOOL)shouldAutorotate {
return YES;//支持转屏
}
这两个函数。
然后在plist文件里面找到Supported interface orientations (iPad)选项,添加你想支持的方向,都有提示的。
然后问题就解决了。
也许我描述的还有问题,希望你能指正。谢谢了。
-(NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskAllButUpsideDown;//这里返回哪个值,就看你想支持那几个方向了。这里必须和后面plist文件里面的一致(我感觉是这样的)。 } 这里的设置会覆盖掉plist中的值 还有需要注意:mainViewController要设置为window的rootViewController,addSubView上去可能存在问题。并且上面的所有subViewController都会受到rootViewController支持朝向的影响 |