We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
这个方法报错在iOS 12下
The text was updated successfully, but these errors were encountered:
改成 [[self.navigationBar subViews] firstObject] . 可以
Sorry, something went wrong.
(void)setNavigationBackgroundAlpha:(CGFloat)navAlpha { CGFloat alpha = MAX(MIN(navAlpha, 1), 0); UIView *barBackground = self.navigationBar.subviews[0]; UIView *colorView = [self getColorViewOnView:barBackground]; colorView.alpha = alpha; if ([barBackground valueForKey:@"_shadowView"]) { UIView *shadowView = [barBackground valueForKey:@"_shadowView"]; shadowView.alpha = alpha; shadowView.hidden = alpha == 0 ? YES : NO; } } 这个方法报错在iOS 12下
[0如果数组为空, 会发生奔溃, 使用firstObject会返回nil, oc里可以给nil发消息
您好, iOS12和之前的系统在navgationbar上有什么更新变化吗, 为什么会导致这个bug呢?往指点
No branches or pull requests
CGFloat alpha = MAX(MIN(navAlpha, 1), 0);
UIView *barBackground = self.navigationBar.subviews[0];
UIView *colorView = [self getColorViewOnView:barBackground];
colorView.alpha = alpha;
if ([barBackground valueForKey:@"_shadowView"]) {
UIView *shadowView = [barBackground valueForKey:@"_shadowView"];
shadowView.alpha = alpha;
shadowView.hidden = alpha == 0 ? YES : NO;
}
}
这个方法报错在iOS 12下
The text was updated successfully, but these errors were encountered: