[TIMOB-7862] iOS: UIPopover background color
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-25T18:09:35.000+0000 |
Affected Version/s | Release 1.8.2 |
Fix Version/s | Release 2.1.0, Sprint 2012-08 |
Components | iOS |
Labels | SupportTeam, api |
Reporter | Rick Blalock |
Assignee | Blain Hamon |
Created | 2012-03-02T07:56:43.000+0000 |
Updated | 2017-03-13T20:33:20.000+0000 |
Description
Previous to 5.0 there was no way to customize the UIPopover background color. From reading the docs and around the web since 5.0 people have been doing it.
References:
https://developer.apple.com/library/ios/#documentation/uikit/reference/UIPopoverController_class/Reference/Reference.html#//apple_ref/occ/instp/UIPopoverController/popoverBackgroundViewClass
https://developer.apple.com/library/ios/#documentation/uikit/reference/UIPopoverBackgroundView_class/Reference/Reference.html#//apple_ref/occ/cl/UIPopoverBackgroundView
http://stackoverflow.com/questions/5974439/customizing-the-uipopovercontroller-view-background-and-border-color
http://stackoverflow.com/questions/8490261/change-color-navigation-controller-in-a-popover
An important point to make: Since this is a 5.0-only feature, it does mean people using the app in 4.0, 4.2, 4.3, etc, will not see the popover color. This should be stressed.
Yup. This is acceptable.
Okay, here's the funny story: As far as I can tell, UIPopover does not have a simple background color property. Instead, it allows you to re-implement the background view. That is, provide the graphics (Sans shadow) that make up the frame of the popover. The catch is that this is per-class, not per instance, and there's no way to pass on property values. Short version: Are they okay with this being a single style, and that they will have to provide graphics instead of a color?
Interesting. So there's no way to customize the color of the UIPopoverBackgroundView? I just read the docs and see what you're saying - sounds like we'd be responsible for adding the border images and all that as well? Is that correct? Yes we're fine with doing that.
Exactly that, yes. From the sample code floating around (unfortunately, none of it from Apple), it looks like we'll have to define several images to use, not just a background image, but images for the arrows in each direction.
Ok makes sense. We're ok with that on our end. The popover design they have is slightly customized all around anyway so this is probably the best thing. Just so I fully understand: The popover design will be a universal thing? e.g. we define those images upfront and that's how all the popovers will look? How will we define this up front? tiapp.xml?
I wouldn't suggest tiapp.xml, and I want something that will last a while if this is making it into core. There's a lot of variables, and the sample code has a lot of hardwiring I have to abstract out. On the native side, there's issues like: view placement, content margins, arrow width and arrow height. On the Titanium side, the issues are what properties to expose and which to calculate or hardwire, how to expose them, and what property names should they have? The documentation is very sparse, and I'll have to look about to see if there's any template images we can use as a source, unless they already have a customized design I can use as a prototype?
Much belated, but now a custom module pull request pending. https://github.com/appcelerator/titanium_modules/pull/30
As the pull request has been accepted, marking this fixed.
Closing ticket as fixed.