Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change color of UIDocumentInteractionController nav bar

Is there a way to change the tint/background color of UIDocumentInteractionController navigationbar?

like image 292
Yogesh Agarwal Avatar asked Jul 28 '11 06:07

Yogesh Agarwal


1 Answers

If you put the UIDocumentInteractionController onto a UINavigationController it will automatically take the color its navbar. This is probably your root view navcontroller.

You do this with the documentInteractionControllerViewControllerForPreview method:

- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller
{
    // Use the rootViewController here so that the preview is pushed onto the navbar stack
    MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
    return appDelegate.window.rootViewController;
}
like image 199
DOOManiac Avatar answered Sep 20 '22 03:09

DOOManiac