zoukankan      html  css  js  c++  java
  • iOS 15 特性及适配

    一、tableview 默认顶部增加一段空白高度

    ​ 这是因为 plain 类型的 UITableView 增加默认的 section 高度,也就是 UITableView 增加了一个新属性:sectionHeaderTopPadding,默认值为automaticDimension,当我们使用UITableViewStylePlain 初始化tableView的时候,sectionHeaderTopPadding 会给 section header 默认增加高度,解决方案是把 sectionHeaderTopPadding 属性设置为0即可:

    if (@available(iOS 15.0, *)) { 
      tableView.sectionHeaderTopPadding = 0;
    }
    
    二、UINavigationBar默认是透明问题

    ​ 在iOS15中,UINavigationBar默认是透明的,向上滑动时会逐渐变为模糊效果,可以通过改变scrollEdgeAppearance属性直接变为模糊效果,代码如下:

    if (@available(iOS 15.0, *)) {
            UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
            appearance.backgroundEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleRegular];
            navBar.scrollEdgeAppearance = appearance;
     }
    
    三、TabBar透明问题

    ​ iOS15中,UITabBar默认背景是透明的,向下滑动是背景会显示出来,可以通过改变scrollEdgeAppearance属性直接显示出来背景色,代码如下:

    if (@available(iOS 15.0, *)) {
       self.tabBar.scrollEdgeAppearance = tabBarAppearance;
    }
    

    暂时遇到以上问题,后续会持续更新中。。。

  • 相关阅读:
    PageObject小结
    python函数默认参数坑
    编译Android 8.0系统 并刷入pixel
    CF 289 F. Progress Monitoring DP计数
    EDU 61 F. Clear the String 区间dp
    Educational Codeforces Round 55 G 最小割
    Educational Codeforces Round 55 E 分治
    hdu 6430 bitset暴力
    AC自动机+DP codeforces86C
    CF895C dp/线性基
  • 原文地址:https://www.cnblogs.com/shisishao/p/15324488.html
Copyright © 2011-2022 走看看