UIPrintInteractionController背景是透明的

时间:2014-04-01 12:46:52

标签: iphone ios7 uiprintinteractioncntrler uiprintinfo

我在控制器中有简单的UIPrintInteractionController,它是模态的,但我得到UIPrintInteractionController的透明背景。您可以在附图中看到问题,

enter image description here

这是我用来呈现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];
}

0 个答案:

没有答案