zoukankan      html  css  js  c++  java
  • iOS 导航栏消失

    iOS15 导航栏在静止时,设置的图片会透明,以及消失。

    解决如下

     if (@available(iOS 13.0, *)) {
                    UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
                    UIImage *backGroundImage = [UIImage imageNamed:@"home_nav_imgV"];
                    backGroundImage = [backGroundImage resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeStretch];
                    appearance.backgroundImage = backGroundImage;
                    appearance.shadowColor = [UIColor clearColor];
                    appearance.shadowImage = [UIImage new];
                    self.navigationController.navigationBar.standardAppearance = appearance;
                    self.navigationController.navigationBar.scrollEdgeAppearance = self.navigationController.navigationBar.standardAppearance;
                } else {
                    UIImage *backGroundImage = [UIImage imageNamed:@"home_nav_imgV"];
                    backGroundImage = [backGroundImage resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeStretch];
                    [self.navigationController.navigationBar setBackgroundImage:backGroundImage forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
                    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
                }
    此文章为个人笔记,方便自己以及有需要的朋友查看,转载请注明出处!
  • 相关阅读:
    Educational Codeforces Round 80 (Rated for Div. 2)
    2020 CCPC Wannafly Winter Camp
    Codeforces Round #613 (Div. 2)
    Codeforces Round #612 (Div. 2)
    Hello 2020
    Good Bye 2019
    Codeforces Round #590 (Div. 3)
    依赖注入
    Spring 拦截器
    rsync服务端一键安装rsync脚本(非源码)
  • 原文地址:https://www.cnblogs.com/shpyoucan/p/15560430.html
Copyright © 2011-2022 走看看