Objective c 定向时UIPopOverViewController出现问题
当Popoverviewcontroller在不同位置显示时 定向前 定向后 代码如下Objective c 定向时UIPopOverViewController出现问题,objective-c,ipad,Objective C,Ipad,当Popoverviewcontroller在不同位置显示时 定向前 定向后 代码如下 -(void)brushType:(id)sender{ brushTypeController = [[BrushTypeViewController alloc]init]; UINavigationController *navigationCtr = [[UINavigationController alloc]initWithRootViewController:brushT
-(void)brushType:(id)sender{
brushTypeController = [[BrushTypeViewController alloc]init];
UINavigationController *navigationCtr = [[UINavigationController alloc]initWithRootViewController:brushTypeController];
brushTypePopOver =[[UIPopoverController alloc]initWithContentViewController:navigationCtr];
[brushTypePopOver presentPopoverFromRect:CGRectMake(0, 10, 30, 20) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
brushTypeController.contentSizeForViewInPopover =CGSizeMake (400, 200);
[navigationCtr release];
}
即使我改变了框架,如果[[UIDevice currentDevice]方向]==UIDeviceOrientationAndscapeLeft | |[[UIDevice currentDevice]方向]==UIDeviceOrientationAndscapeRight{change frame}或者{你的框架}而不是硬编码当前的PoverfromRect:cRectmake0,10,30,20你能在UINavigationBar中传递按钮的框架吗?我同意从UIBarButtonim显示Popover是最好的,尽管当你有一个自定义工具栏和自定义EWBarButton项时,操作绑定到UIButton,而不是UIBarButtonim。所以你最后不得不把它呈现出来。我想知道如何在定向/键盘等之后更改popover的位置。