Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force black borders for UIPopoverControllers

UIPopoverController instances can be restyled in iOS5 using the UIPopoverBackgroundView class. However this customisation technique cannot be applied to UIActionSheets (presented as popovers in iPad). I'd like my popovers to appear consistent so UIPopoverBackgroundView isn't an option for me.

Poking through the iOS artwork (using extractor) I notice that alongside the _UIPopoverViewBlue* PNGs (presumably used to draw the default blue-ish UIPopoverController borders) is a _UIPopoverViewBlack* set of PNGs. How do I get UIPopoverController to use the black images instead of the blue ones?

like image 654
Jaysen Marais Avatar asked Jun 01 '12 07:06

Jaysen Marais


1 Answers

It appears there’s no way to achieve this officially. I doubt it will pass the App Store review process, but this works for me on iOS 6:

[popoverController setValue:@3 forKey:@"_popoverBackgroundStyle"];

It’s a shame Apple didn’t just expose this publicly.

like image 178
freyaariel Avatar answered Nov 15 '22 12:11

freyaariel