我正在开发一款使用相机功能的iPad应用程序。我正在将相机打开到UIPopoverController中。我的应用程序仅支持纵向方向,我想限制UIPopoverController也只支持纵向方向。
任何帮助都会很明显。
先谢谢。
答案 0 :(得分:0)
要限制以纵向模式查看您的应用,请将其设置为....
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return NO;
}
在所有班级中设置return NO
......:)
答案 1 :(得分:0)
创建UIPopoverController的对象实例。方向改变时隐藏和取消隐藏。
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight))
{
// hidden your popover
}
return YES;
}