我的应用程序(iPad;iOS6)是一个仅适用于风景的应用程序,但当我尝试使用UIPopoverController显示图片库时,它抛出了这个错误:Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES.
我已经尝试更改了很多代码,但没有成功。
发布于 2012-10-11 15:28:58
在花了很多时间寻找一种方法来避免子类化和添加大量代码后,下面是我的一行代码解决方案。
创建一个新的UIImagePickerController类别并添加
-(BOOL)shouldAutorotate{
return NO;
}
这就是所有的人!
发布于 2012-11-13 01:30:31
我有一个类似的问题,当呈现图像拾取器在一个仅景观的应用程序中。根据Luiji博士的建议,我在控制器的开头添加了以下类别。
// This category (i.e. class extension) is a workaround to get the
// Image PickerController to appear in landscape mode.
@interface UIImagePickerController(Nonrotating)
- (BOOL)shouldAutorotate;
@end
@implementation UIImagePickerController(Nonrotating)
- (BOOL)shouldAutorotate {
return NO;
}
@end
将这些行添加到ViewController .m文件的@实现之前是最简单的。
发布于 2013-01-23 07:37:35
我在我的代码中遇到了同样的错误消息。我发现了这个,据苹果报道,这是一个错误:
https://devforums.apple.com/message/731764#731764
他的解决方案是在AppDelegate中修复它。我实现了它,它对我来说是有效的!
https://stackoverflow.com/questions/12540597
复制相似问题