美文网首页
解决iOS 15 导航栏变白 透明

解决iOS 15 导航栏变白 透明

作者: YoungHer | 来源:发表于2021-11-25 14:37 被阅读0次

    AppDelegate - didFinishLaunchingWithOptions新增

    //解决iOS 15 导航栏透明问题

        if(@available(iOS 13.0, *)) {

            UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];

            [appearance configureWithOpaqueBackground];

            appearance.backgroundColor=_COLOR_NAVIGATION;

            appearance.titleTextAttributes = NAVIGATIONBAR_TITLE_ATTRIBUTES_DICTIONARY;

            [[UINavigationBar appearance] setStandardAppearance:appearance];

            [[UINavigationBar appearance] setScrollEdgeAppearance:appearance];

        }else{

            // Fallback on earlier versions

        }

    相关文章

      网友评论

          本文标题:解决iOS 15 导航栏变白 透明

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