我正在尝试修改使用 UIPrint 时出现的打印选项。
UIPrintInteractionController *pic;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if (!completed && error) {
NSLog(@"Printing could not complete because of error: %@", error);
}
};
[pic presentAnimated:YES completionHandler:completionHandler];
有一个您可以响应的委托:
- (UIViewController *)printInteractionControllerParentViewController:(UIPrintInteractionController *)printInteractionController
如果我从这里返回 nil,则会显示对话框。如果我返回导航视图控制器的视图控制器,则不会出现打印选项。我不知道为什么。
在一个相关的问题上,是否可以在不使用打印选项的情况下获取打印机列表,然后打印到特定的打印机(从而无需显示打印机选项视图)。