iOS15 UI相关的适配

380 阅读1分钟

这是我参与11月更文挑战的第7天,活动详情查看:2021最后一次更文挑战

引言

一年一度的iOS 系统 API适配来了,9 月 14 日起 App Store Connect 已经开放 iOS 15 和 iPadOS 15 App 的提交,同时苹果宣布自 2022 年 4 月起,所有提交至 App Store 的 iOS 和 iPadOS app 都必须使用 Xcode 13 和 iOS 15 SDK 构建。

Xcode 13 正式版包含 iOS 15,iPadOS 15,tvOS 15,watchOS 8 以及 macOS Big Sur 11.3 SDK。Xcode 13 需在 macOS 11.3 及以上版本运行,支持 iOS 9,tvOS 9,watchOS 2 及以上系统设备调试;

也正式支持了 Vim。

Xcode 13 Release Notes: developer.apple.com/documentati… 在这里插入图片描述

II TableView 适配

sectionHeaderTopPadding

在这里插入图片描述

/// Padding above each section header. The default value is UITableViewAutomaticDimension.
///每个节标题上方的填充。默认值为UITableViewAutomaticDimension。
@property (nonatomic, getter=isPrefetchingEnabled) BOOL prefetchingEnabled


iOS 15中 UITableView 新增了一个属性:sectionHeaderTopPadding。此属性会给每一个 section header 增加一个默认高度,当我们使用 UITableViewStylePlain 初始化UITableView 的时候,系统默认给 section header 增高了22像素,形成一个section之间的间距。

//在创建实例的时候进行section间距的设置

if (@available(iOS 15.0, *)) {
    tableView.sectionHeaderTopPadding = 0;
} 

//全局设置

if (@available(iOS 15.0, *)) {
    [UITableView appearance].sectionHeaderTopPadding = 0;
}


II 导航条主题: 背景颜色、标题颜色

kunnan.blog.csdn.net/article/det…

更多内容请关注 小程序:iOS逆向,只为你呈现有价值的信息,专注于移动端技术研究领域。