Nabeel Ahmed
Nabeel Ahmed

Reputation: 125

Done button text Color of UIDocumentInteractionController

can i change the text colour of Done button in UIDocumentInteractionController? Currently there is a white Done button which is not giving proper look

Upvotes: 2

Views: 1163

Answers (1)

arlomedia
arlomedia

Reputation: 9061

Are you setting a tintColor for your app window? That will change the color of some system-generated buttons, like the Cancel button in a UIDocumentInteractionController on an iPhone. I couldn't find a way to override that, so I ended up temporarily changing the app tint color before showing a document interaction controller, then changing it back:

- (IBAction)openIn:(NSURL *)URL {
    UIDocumentInteractionController *controller = [[UIDocumentInteractionController interactionControllerWithURL:URL] retain];
    controller.delegate = self;
    self.appDelegate.window.tintColor = [UIColor blackColor]; // temporary override
    [controller presentOpenInMenuFromBarButtonItem:self.openInButton animated:TRUE];
}

- (void)documentInteractionControllerDidDismissOpenInMenu:controller {
    [controller release];
    self.appDelegate.window.tintColor = self.appDelegate.textColor; // restore the tintColor
}

I plan to file a bug report for this, because my app has a dark color theme with white text, and that creates white text on a white background in lots of system-provided UI elements. I think these elements should only change their text color to match the app if they also offer a way to change their background color to match the app.

Upvotes: 1

Related Questions