获取_UIBarBackgroundShadowView,通过获取到的UIView来设置隐藏/显示
[self.navigationController.navigationBar.subviews.firstObject.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj isKindOfClass:NSClassFromString(@"_UIBarBackgroundShadowView")]) {
obj.hidden=YES;
}
}];
网友评论