1

我正在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;
}
4

1 回答 1

1

尝试为视图控制器设置contentSizeForViewInPopover

yourViewController.contentSizeForViewInPopover = CGSizeMake(320.0, 750.0);

您可以在初始化我们的控制器时设置它。

于 2013-03-21T15:02:34.220 回答