2

I have simple UIPrintInteractionController in a controller that is presnented modally but I am getting transparent background of UIPrintInteractionController. You can see the issue in attached picture,

enter image description here

This is the code I am using to present 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];
}
4

0 回答 0