我在控制器中有简单的UIPrintInteractionController,它是模态的,但我得到UIPrintInteractionController的透明背景。您可以在附图中看到问题,
这是我用来呈现UIPrintInteractionController的代码,
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
if(!pic){
NSLog(@"Couldn't get shared UIPrintInteractionController!");
return;
}
// We need a completion handler block for printing.
UIPrintInteractionCompletionHandler completionHandler = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if(completed && error)
NSLog(@"FAILED! due to error in domain %@ with error code %u", error.domain, error.code);
};
if(pic && [UIPrintInteractionController canPrintData: myData] ) {
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType isEqualToString:@"iPhone"]) {
pic.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = [_filePath lastPathComponent];
printInfo.duplex = UIPrintInfoDuplexLongEdge;
[printInfo setOrientation:UIPrintInfoOrientationPortrait];
pic.printInfo = printInfo;
pic.showsPageRange = YES;
pic.printingItem = myData;
docsScrollView.hidden = YES;
toolBar.hidden = YES;
self.modalPresentationStyle = UIModalPresentationFullScreen;
[pic presentAnimated:YES completionHandler:completionHandler];
}