0
votes

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

1
Have you tried setting activity.view.backgroundColor?Carl Veazey
@CarlVeazey Yes please see new description for an image of the resultStephen
Have you tried using a custom UIPopoverBackgroundView class (via the popoverBackgroundViewClass property of the popover controller)?omz

1 Answers

2
votes

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