更改UIPrintInteractionController导航栏标题

时间:2013-12-12 03:42:14

标签: ios printing title navigationbar

如何更改UIPrintInteractionController的导航栏标题(打印机选项)?

enter image description here

2 个答案:

答案 0 :(得分:3)

您可以使用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];
}

答案 1 :(得分:0)

#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]}];
}