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 に答える