Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7862] iOS: UIPopover background color

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-25T18:09:35.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sRelease 2.1.0, Sprint 2012-08
ComponentsiOS
LabelsSupportTeam, api
ReporterRick Blalock
AssigneeBlain Hamon
Created2012-03-02T07:56:43.000+0000
Updated2017-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

Comments

  1. Blain Hamon 2012-03-30

    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.
  2. Rick Blalock 2012-03-30

    Yup. This is acceptable.
  3. Blain Hamon 2012-04-02

    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?
  4. Rick Blalock 2012-04-02

    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.
  5. Blain Hamon 2012-04-02

    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.
  6. Rick Blalock 2012-04-02

    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?
  7. Blain Hamon 2012-04-02

    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?
  8. Blain Hamon 2012-04-16

    Much belated, but now a custom module pull request pending. https://github.com/appcelerator/titanium_modules/pull/30
  9. Blain Hamon 2012-04-25

    As the pull request has been accepted, marking this fixed.
  10. Lee Morris 2017-03-13

    Closing ticket as fixed.

JSON Source