美文网首页
iOS 15 (xcode 13) 更新后出现的bug

iOS 15 (xcode 13) 更新后出现的bug

作者: 谢千域 | 来源:发表于2021-10-23 16:43 被阅读0次


    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;

        }

    相关文章

      网友评论

          本文标题:iOS 15 (xcode 13) 更新后出现的bug

          本文链接:https://www.haomeiwen.com/subject/aikjvltx.html