IOS之系统15.0版本后移动端APP状态栏+导航栏需要滑动才会显示

大家好!最近较忙,今天给大家阐述一个IOS手机15.0后新版本的问题,在移动端测试项目时,小屏幕苹果手机系统正常,但在类似iphone Max这样升级到15.0就会有个小问题,状态栏白色的,需要往上稍微拉动一下才会显示;

一:进入15.0的手机做一个判断,就兼容到最新的系统了

Object-C版本

 UIColor *commonBlue = [self.cmUtil stringToColor:@"#506168"];
    if (@available(iOS 15.0, *)) {
            UINavigationBarAppearance *appperance = [[UINavigationBarAppearance alloc] init];
            //添加背景色
            appperance.backgroundColor = commonBlue;
            appperance.shadowImage = [[UIImage alloc]init];
            appperance.shadowColor = nil;
            //设置字体颜色大小
            [appperance setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
            self.navigationController.navigationBar.standardAppearance = appperance;
            self.navigationController.navigationBar.scrollEdgeAppearance = appperance;
            self.navigationController.navigationBar.compactAppearance = appperance;
            self.navigationController.navigationBar.compactScrollEdgeAppearance = appperance;
        }
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationItem.title = @"Me";

Swfit版本

    let commonBlue = UIColor(hexString: "#353535", transparency: 1.0)
    if #available(iOS 15.0, *) {
        let appperance = UINavigationBarAppearance()
        //添加背景色
        appperance.backgroundColor = commonBlue
        appperance.shadowImage = UIImage()
        appperance.shadowColor = nil
        //设置字体颜色大小
        appperance.titleTextAttributes = [
            .foregroundColor: UIColor.white
        ]
        navigationController?.navigationBar.standardAppearance = appperance
        navigationController?.navigationBar.scrollEdgeAppearance = appperance
        navigationController?.navigationBar.compactAppearance = appperance
        navigationController?.navigationBar.compactScrollEdgeAppearance = appperance
    }
        navigationController?.navigationBar.barTintColor = commonBlue
        navigationController?.navigationBar.tintColor = .white
        self.navigationItem.title = "Ble List"

在这里插入图片描述