- UINavigationBar
在iOS 15中萝勤,UINavigationBar默認為透明。在滑動時會有模糊效果呐伞。如果想要一直就是模糊效果敌卓,可以通過改變scrollEdgeAppearance屬性來實現(xiàn)。
解決辦法:
UINavigationBarAppearance *barApp = [[UINavigationBarAppearance alloc] init];
barApp.backgroundEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleRegular];
self.navigationBar.scrollEdgeAppearance = barApp;
UINavigationBar伶氢、UIToolbar 和 UITabBar 將在你的VC關(guān)聯(lián)滾動視圖位于適當?shù)倪吘墪r使用 scrollEdgeAppearance(或者如果您的視圖層級結(jié)構(gòu)中沒有 UIScrollView趟径,更多內(nèi)容見下文)。
您必須使用 UIBarAppearance API 來自定義癣防。UIToolbar 和 UITabBar 為此在 iOS 15 中添加了 scrollEdgeAppearance 屬性蜗巧。
解決辦法:
if (@available(iOS 15.0, *)) {
UINavigationBarAppearance *barApp = [UINavigationBarAppearance new];
barApp.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:0.5];
self.navigationController.navigationBar.scrollEdgeAppearance = barApp;
self.navigationController.navigationBar.standardAppearance = barApp;
}
- iOS 15 UITableView sectionHeader下移22像素
iOS 15中 UITableView 新增了一個屬性:sectionHeaderTopPadding。此屬性會給每一個 section header 增加一個默認高度蕾盯,當我們使用 UITableViewStylePlain 初始化UITableView 的時候幕屹,系統(tǒng)默認給 section header 增高了22像素。
解決辦法:
if (@available(iOS 15.0, *)) {
tableView.sectionHeaderTopPadding = 0;
}
3级遭、對狀態(tài)編程的支持:UICellConfigurationState香嗓;UICollectionViewCell、UITableViewCell都支持狀態(tài)變化時的block執(zhí)行了装畅。
4靠娱、UICollectionViewLayout支持自動高度;AutomaticDimension
5掠兄、json解析支持json5了
6像云、增加UISheetPresentationController,通過它可以控制 Modal 出來的 UIViewController 的顯示大小蚂夕,且可以通過拖拽手勢在不同大小之間進行切換迅诬。
7、UIButton支持更多配置婿牍。UIButton.Configuration是一個新的結(jié)構(gòu)體侈贷,它指定按鈕及其內(nèi)容的外觀和行為。它有許多與按鈕外觀和內(nèi)容相關(guān)的屬性等脂,如cornerStyle俏蛮、baseForegroundColor撑蚌、baseBackgroundColor、buttonSize搏屑、title争涌、image、subtitle辣恋、titlePadding亮垫、imagePadding、contentInsets伟骨、imagePlacement等饮潦。
8、推出CLLocationButton用于一次性定位授權(quán)携狭,該內(nèi)容內(nèi)置于CoreLocationUI模塊害晦,但如果需要獲取定位的詳細信息仍然需要借助于CoreLocation。
9暑中、URLSession 推出支持 async/await 的 API壹瘟,包括獲取數(shù)據(jù)、上傳與下載
10鳄逾、系統(tǒng)圖片支持多個層稻轨,支持多種渲染模式。
11雕凹、UIImage 新增了幾個調(diào)整尺寸的方法殴俱。