UITableView sectionHeader下移22像素?
swift
if#available(iOS15.0, *) {
? ? ? ? ? ? self.mainTableView.sectionHeaderTopPadding =0? ? ? ? }
OC
? ? ? ? if(@available(iOS15.0, *)) {
? ? ? ? ? ? _downloadTableView.sectionHeaderTopPadding = 0;
? ? ? ? }
導航背景顏色修改無效?
swift
if #available(iOS 15.0, *) {
? ? ? ? ? ? let appearance = UITabBarAppearance()
? ? ? ? ? ? appearance.configureWithOpaqueBackground()
? ? ? ? ? ? if darkMode {
? ? ? ? ? ? ? ? appearance.backgroundColor = UIColor.darkBackgroundColour
? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? appearance.backgroundColor = .white
? ? ? ? ? ? }
? ? ? ? ? ? appearance.shadowImage = nil
? ? ? ? ? ? appearance.shadowColor = nil
? ? ? ? ? ? appDelegate.tabBarController.tabBar.standardAppearance = appearance
? ? ? ? ? ? appDelegate.tabBarController.tabBar.scrollEdgeAppearance = appDelegate.tabBarController.tabBar.standardAppearance
? ? ? ? }
OC
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;
? ? }