我想打印一些 PDF NSData,当我UIPrintInteractionController
正确呈现 PDF 时,文本和其他数据UITableViewCell
不UIPrintInteractionController
可见。
代码:
UIPrintInteractionController *printController = [UIPrintInteractionController sharedPrintController];
printController.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = [self.pdfURL lastPathComponent];
printInfo.duplex = UIPrintInfoDuplexLongEdge;
printController.printInfo = printInfo;
printController.showsPageRange = YES;
printController.printingItem = self.pdfData;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if (!completed && error) {
NSLog(@"FAILED! due to error in domain %@ with error code %lu", error.domain, (long)error.code);
}
};
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[printController presentFromBarButtonItem:sender animated:true completionHandler:completionHandler];
} else {
[printController presentAnimated:YES completionHandler:completionHandler];
}
什么会导致这样的问题以及如何解决?
更新:
忽略这个问题后,我发现UITableViewCell
我的应用程序中的任何子类都textLabel.textColor
默认设置为白色。而且我无法以编程方式或在 IB 中更改它。