2013-03-21 66 views
1

我按UIPrintInteractionControllerDelegate的要求执行printInteractionControllerParentViewController:来定制显示打印选项的弹出窗口。这是运行,弹出窗口出现在(肖像)iPad的整个高度的大小,在缩小到正常大小之前。如何实现printInteractionControllerParentViewController:使用弹出窗口?

任何关于如何以更合理的方式显示弹出窗口的建议将会有所帮助。

这里是我的实现:

- (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; 
} 

回答

1

尝试将contentSizeForViewInPopover的视图控制器:

yourViewController.contentSizeForViewInPopover = CGSizeMake(320.0, 750.0); 

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

相关问题