Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在iOS8和iOS9中会崩溃…… #17

Open
xnxy opened this issue Nov 16, 2017 · 2 comments
Open

在iOS8和iOS9中会崩溃…… #17

xnxy opened this issue Nov 16, 2017 · 2 comments

Comments

@xnxy
Copy link

xnxy commented Nov 16, 2017

将UINavigationController+Cloudox.m 方法“- (void)setNeedsNavigationBackground:(CGFloat)alpha” 中的barBackgroundView、backgroundImageView、backgroundEffectView修改成下方……

// 导航栏背景透明度设置
UIView *barBackgroundView;// _UIBarBackground
UIImageView *backgroundImageView;// UIImageView
UIView *backgroundEffectView;// UIVisualEffectView

if (@available(iOS 10.0, *)) {//
    barBackgroundView = [self.navigationBar.subviews objectAtIndex:0];
    backgroundImageView = [barBackgroundView.subviews objectAtIndex:0];
    backgroundEffectView = [barBackgroundView.subviews objectAtIndex:1];
}else{
    for (UIView *view in self.navigationBar.subviews) {
        if ([view isKindOfClass:NSClassFromString(@"_UINavigationBarBackground")]) {
            barBackgroundView = view;
        }
    }
    for (UIView *otherView in barBackgroundView.subviews) {
        if ([otherView isKindOfClass:NSClassFromString(@"UIImageView")]) {
            backgroundImageView = (UIImageView *)otherView;
        }else if ([otherView isKindOfClass:NSClassFromString(@"_UIBackdropView")]) {
            backgroundEffectView = otherView;
        }
    }
}
@xnxy
Copy link
Author

xnxy commented Nov 17, 2017

竟然又发现了一个坑……

@zcwlwen
Copy link

zcwlwen commented Mar 22, 2018

iOS 这个导航栏就是个大坑啊。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants