一个简单的解决方法可能如下:
就在您显示您的UIPopoverController
集合UIScrollView
的属性scrollsToTop
之前NO
。这样,当用户点击状态栏时,您的 scrollView 将不会滚动。
完成弹出框后,您可以重新启用 scrollsToTop 功能。
这是UIScrollView 文档:
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.
希望这可以帮助!