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

ios10适配 #47

Open
al1020119 opened this issue Sep 5, 2016 · 4 comments
Open

ios10适配 #47

al1020119 opened this issue Sep 5, 2016 · 4 comments

Comments

@al1020119
Copy link

如果导航栏设置了透明的话,iOS10上面导航栏完全是是白色的标题也看不清。

@iHTCboy
Copy link

iHTCboy commented Sep 9, 2016

我目前也遇到这个问题啊,求解!

@langhua9527
Copy link

#37

@iHTCboy
Copy link

iHTCboy commented Sep 12, 2016

#37 还是不能解决问题。

我的是自定义一个naviBar,默认是不显示背影,上拉后淡出。
我的解决方法:

if (IS_iOS10) {
    naviBar.translucent = YES;
    [naviBar lt_setBackgroundColor:[UIColor clearColor]];
}

文件UINavigationBar+Awesome.h 里面的方法lt_setBackgroundColor 要是下面的:

- (void)lt_setBackgroundColor:(UIColor *)backgroundColor
{
    if (!self.overlay) {
        [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
        self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)];
        self.overlay.userInteractionEnabled = NO;
        self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        [self insertSubview:self.overlay atIndex:0];
    }
    self.overlay.backgroundColor = backgroundColor;
}

@al1020119

@zwind007
Copy link

issues里有人提过这个问题,据说新版v2.1.7解决了,不过我这边尝试透明时还是显示白色。
后来仿照了美团app,直接隐藏了_UINavigationBarBackground(iOS9)或_UIBarBackground(iOS10)这个view,背景自然就透明了,然后自定义了个view,放在导航栏下面,通过设置view的背景色来达到每个控制器导航栏颜色不同的需求。

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

4 participants