简体   繁体   English

更改UIPrintInteractionController导航栏标题

[英]Change UIPrintInteractionController Navigation Bar Title

How to change the UIPrintInteractionController's navigation bar title (Printer Options)? 如何更改UIPrintInteractionController的导航栏标题(打印机选项)?

在此处输入图片说明

You can use UIPrintInteractionController's delegate methods for change appearance of it, 您可以使用UIPrintInteractionController的委托方法来更改其外观,

- (UIViewController *)printInteractionControllerParentViewController:   (UIPrintInteractionController *)printInteractionController
{
    return self.navigationController;
}
- (void)printInteractionControllerDidPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController
{
    // self.navigationController.topViewController.navigationController.navigationBar.tintColor=[UIColor redColor];
    self.navigationController.navigationBar.tintColor = [UIColor greenColor];

   // self.navigationController.topViewController.navigationController.navigationBar.barTintColor=[UIColor purpleColor];
   self.navigationController.topViewController.navigationController.navigationBar.tintColor=[UIColor yellowColor];
}
#pragma mark - Print Delegate -

- (UIViewController *)printInteractionControllerParentViewController:(UIPrintInteractionController *)printInteractionController {

    return self.navigationController;
}

- (void)printInteractionControllerDidPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController {

 [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];
    self.navigationController.navigationBar.barTintColor = AppColor;
    self.navigationController.topViewController.navigationController.navigationBar.tintColor=[UIColor whiteColor];

 [[UINavigationBar appearance] setTitleTextAttributes:
     @{NSForegroundColorAttributeName: [UIColor whiteColor]}];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM