Stephen
Stephen

Reputation: 1436

UIActivityViewController color

It seems like there is no Apple permitted way to change the color of a uiactivityviewcontroller. I am creating it in my iPad app like this:

UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:@[@"test"] applicationActivities:nil];
shareOptions = [[UIPopoverController alloc] initWithContentViewController:activity];  
[shareOptions presentPopoverFromBarButtonItem:actionBarButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

This currently presents the popover with a blueish background color. I have seen a black background color used so I know it is possible. Another developer mentioned to me he thought on the iPhone at least it appears to be determined by the status bar color (as setting the status bar color to black opaque in the info.plist made the activityview black). This did not seem to have an effect on the iPad version. Does anyone have any ideas/suggestions?

Thanks!

UPDATE: Setting activity.view.backgroundColor yields a weird result where most of the view is the set color but the edges are still the original blue

UIActivityViewController Weird Background

Upvotes: 0

Views: 1092

Answers (1)

BPS
BPS

Reputation: 36

That's mentioned on the WWDC 2012 Video : Session 200 - What's new in Cocoa Touch. The blueish part is a default layover you can deactivate with

UIPopoverBackgroundView +(BOOL)wantsDefaultContentAppearance

Upvotes: 2

Related Questions