如何限制只有纵向方向的UIPopoverController?
问题描述:
我正在开发一款使用相机功能的iPad应用程序。我打开相机到UIPopoverController。我的应用程序只支持纵向,我想限制UIPopoverController也只支持纵向。如何限制只有纵向方向的UIPopoverController?
任何帮助将是可观的。
在此先感谢。
答
限制乌尔应用在纵向模式观看,设置此一个....
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return NO;
}
集return NO
在所有类... :)
答
创建UIPopoverController的对象实例。每当方向改变时隐藏和取消隐藏。
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight))
{
// hidden your popover
}
return YES;
}