我是 ios 开发的新手。我有一个主 viewController 有导航项,而我点击导航项弹出视图控制器看起来很好并且 gettig 确切 contentSize For View In Popover(320,845),问题是当我点击弹出视图控制器内的按钮时弹出内容大小有被改变。
UIBarButtonItem *btn = (UIBarButtonItem *)sender;
Agamam *agamamView = [[Agamam alloc] initWithNibName:@"Agamam" bundle:nil];
agamamView.delegate=self;
agamamView.contentSizeForViewInPopover =CGSizeMake(agamamView.view.frame.size.width, agamamView.view.frame.size.height);
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:agamamView];
popAgamamView = [[UIPopoverController alloc] initWithContentViewController:navController];
[popAgamamView presentPopoverFromBarButtonItem:btn permittedArrowDirections:YES animated:YES];