Compiling against 5.1 SDK forces new UIPopoverController “slide in” presentation of popovers — how to disable?

萝らか妹 提交于 2019-11-30 06:37:59

This change seems poorly thought out. Sure guys, we break anything in the detail view that uses a swipe. Awesome!

To answer your 'bring back the black' question, if it's merely a question of the top navbar color, you could use the appearance proxy. For example:

[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];

The appearance proxy can be set very specifically if necessary; it has a containers model. There's a very good WWDC video on it.

With respect to just reverting to the old behavior with the new compiler, frankly, I'd love to know as well. The new behavior also breaks action sheets in the master view; previously, when the master view was presented in a popover, they'd do the right thing. Now, it's an assertion failure.

Steve Morton

Ok I had the same issue, this may help, it removes the black background that reaches to the bottom of the screen....

call this after you display your popoup...

- (void)removeInnerShadow {
    UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
    for (UIView *windowSubView in window.subviews) {

            if ([NSStringFromClass([windowSubView class]) isEqualToString:@"UIDimmingView"]) {
            for (UIView *dimmingViewSubviews in windowSubView.subviews) {

                for (UIView *popoverSubview in dimmingViewSubviews.subviews) {

                    popoverSubview.layer.shadowOpacity=0;
                    popoverSubview.layer.masksToBounds = NO;

                     if([NSStringFromClass([popoverSubview class]) isEqualToString:@"_UIPopoverSlidingChromeView"])
                     {

                         popoverSubview.layer.shadowOpacity=0;
                         popoverSubview.layer.masksToBounds = NO;

                     }
                }
            }
        }
    }
}

It is possible to revert! - with MGSplitViewController. It gives you a similar API to the iOS control but with old popover and much more control.

as of iOS 5.1

From the docs:

In iOS 5.1, the UISplitViewController class adopts the sliding presentation style when presenting the left view (previously seen only in Mail). This style is used when presentation is initiated either by the existing bar button item provided by the delegate methods or by a swipe gesture within the right view. No additional API adoption is required to obtain this behavior, and all existing APIs—including that of the UIPopoverController instance provided by the delegate—will continue to work as before.

small work around over here ->

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!