0

I've found that when presenting a UIPopoverController not all controls in the presenting view are disabled. Specifically, the navbar buttons (e.g. 'back') remain selectable. This is a defect in my opinion - it allows the popover to remain on screen, while the view stack pops behind it.

Oh well, at least this can be rectified using self.aboutPopoverController.passthroughViews = nil immediately after presentation.

Except this doesn't disable the status bar, which is often set up to scroll the view's content to the top.

The end result is the ability to present a popover, and then (in the background) scroll the view so that the small arrow/tab on the popover is no longer aligned with the original touch point.

Can anyone shed some light on this behavior? Is it a feature or a bug? Any workarounds?

Ben Packard
  • 26,102
  • 25
  • 102
  • 183

1 Answers1

1

A simple workaround could be the following:

Just before you display your UIPopoverController set UIScrollView's property scrollsToTop to NO. This way when the user taps on the status bar your scrollView won't scroll.

When you're done with the popover you can re-enable the scrollsToTop functionality.

Here is the UIScrollView documentation:

scrollsToTop
A Boolean value that controls whether the scroll-to-top gesture is enabled.

@property(nonatomic) BOOL scrollsToTop

Discussion
The scroll-to-top gesture is a tap on the status bar. When a user makes this gesture, 
the system asks the scroll view closest to the status bar to scroll to the top. 
If that scroll view has scrollsToTop set to NO, its delegate returns NO from
scrollViewShouldScrollToTop:, or the content is already at the top, nothing happens.

Hope this helps!

LuisCien
  • 6,362
  • 4
  • 34
  • 42
  • Thanks - that's actually close to my current workaround. Except instead of ignoring the tap I am dismissing the popover and returning YES – Ben Packard Oct 19 '13 at 01:31