美文网首页
iOS 15.0+ push导航栏透明变换

iOS 15.0+ push导航栏透明变换

作者: 刃之剑 | 来源:发表于2021-12-07 15:38 被阅读0次
    if(@available(ios 15.0,*)){
            UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
            [appearance configureWithOpaqueBackground];
            appearance.backgroundColor = [UIColor whiteColor];
            appearance.shadowColor = [UIColor clearColor];
            self.navigationBar.standardAppearance = appearance;
            self.navigationBar.scrollEdgeAppearance=self.navigationBar.standardAppearance;
        }
        
    

    添加上面这段代码就可以实现去除透明变化的影响.去除导航栏下面的黑线.

    appearance.shadowColor = [UIColor clearColor];
    

    相关文章

      网友评论

          本文标题:iOS 15.0+ push导航栏透明变换

          本文链接:https://www.haomeiwen.com/subject/xucaxrtx.html