Missing Buttons from AirPrint Dialog Box

I implemented AirPrinting from my application, but I had a strange problem. When the print dialog appears, the Cancel or Finish / Print buttons do not appear on the display, as shown in the following figure.

enter image description here

The code I use is as follows:

if ([UIPrintInteractionController canPrintURL:pdfUrl]) {  
        UIPrintInfo *aPrintInfo = [UIPrintInfo printInfo];  
        aPrintInfo.outputType = UIPrintInfoOutputGeneral;  
        aPrintInfo.jobName = [NSString stringWithFormat:@"%@-PRINT",[[NSUserDefaults standardUserDefaults] stringForKey:@"Kiosk ID"]];  
        UIPrintInteractionController *aPrintController = [UIPrintInteractionController sharedPrintController];  
        aPrintController.showsNumberOfCopies=YES;  
        aPrintController.showsPaperSelectionForLoadedPapers=YES;  
        aPrintController.printingItem = pdfUrl;  
        aPrintController.printInfo = aPrintInfo;  
        [aPrintController presentAnimated:YES completionHandler:NULL];  
}  

Does anyone have any experience with this issue and know how to fix it? What is really strange is that the actions for these hidden buttons still work; therefore, if I click where the print button should be, it will print, and I can also close the dialog box by clicking the upper left corner where the Cancel button should be.

Hooray!

ps, using the latest version of iOS 11, the problem occurs in the simulator and on the device.

[] Apple, https://developer.apple.com/library/content/samplecode/PrintBanner/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013422-Intro-DontLinkElementID_2

AirPrint ( , , ), , ( ), - . .

[ 2] , . , . - , ? , ? , , - , .

[ 3] , , , Pods , UIImage. , , , . , . Xcode, - , - , ?

[ 4] , , . Quell , .

[ 5] ! , , , . - , Clear, , . , , . , Tint, .

+4
2

UIPrintInteractionController. , "" "" . - .

. ​​

self.navigationBar.barStyle = UIBarStyle.Black
self.navigationBar.tintColor = .black

. - . , .

+3

, , , iOS 11.

([UIPrintInteractionController canPrintURL:self.pdfUrl]) {
        UIPrintInfo *aPrintInfo = [UIPrintInfo printInfo];
        aPrintInfo.outputType = UIPrintInfoOutputGeneral;
        aPrintInfo.jobName = @"test job";
        UIPrintInteractionController *aPrintController = [UIPrintInteractionController sharedPrintController];
        aPrintController.showsNumberOfCopies=YES;
        aPrintController.showsPaperSelectionForLoadedPapers=YES;
        aPrintController.printingItem = self.pdfUrl;
        aPrintController.printInfo = aPrintInfo;
        [aPrintController presentAnimated:YES completionHandler:NULL];
    }

, , pdfUrl URL-, , , URL-.

URL-,

self.pdfUrl = [NSURL URLWithString:@"http://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf"];

1: -

enter image description here

+1

Source: https://habr.com/ru/post/1691866/


All Articles