我正在printInteractionControllerParentViewController:
根据需要UIPrintInteractionControllerDelegate
自定义显示打印选项的弹出框。运行时,弹出框出现在(纵向)iPad 的全高大小,然后缩小到正常大小。
任何有关如何以更明智的方式出现弹出框的建议都会有所帮助。
这是我的实现:
- (UIViewController*)printInteractionControllerParentViewController:(UIPrintInteractionController*)printInteractionController {
UINavigationController* navigationController = [[UINavigationController alloc] init];
popover = [[UIPopoverController alloc] initWithContentViewController:navigationController];
[popover setPopoverBackgroundViewClass:[CustomPopoverBackgroundView class]];
[popover presentPopoverFromRect:_printButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[popover.contentViewController.view setBackgroundColor:backgroundColor];
return navigationController;
}