Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 定向时UIPopOverViewController出现问题_Objective C_Ipad - Fatal编程技术网

Objective c 定向时UIPopOverViewController出现问题

Objective c 定向时UIPopOverViewController出现问题,objective-c,ipad,Objective C,Ipad,当Popoverviewcontroller在不同位置显示时 定向前 定向后 代码如下 -(void)brushType:(id)sender{ brushTypeController = [[BrushTypeViewController alloc]init]; UINavigationController *navigationCtr = [[UINavigationController alloc]initWithRootViewController:brushT

当Popoverviewcontroller在不同位置显示时

定向前

定向后

代码如下

-(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的位置。