1.自定义导航栏的 - (void)viewDidLoad 方法中添加
if (@available(iOS 15.0, *)) {
UINavigationBarAppearance * appearance = [[UINavigationBarAppearance alloc] init];
// 带scroll滑动的页面
self.navigationController.navigationBar.scrollEdgeAppearance = appearance;
// 常规页面
self.navigationController.navigationBar.standardAppearance = appearance;
self.navigationController.navigationBar.compactAppearance = appearance;
self.navigationController.navigationBar.compactScrollEdgeAppearance = appearance;
}
2.自定义Tabbar 的 - (void)viewDidLoad 方法中添加
if (@available(iOS 15.0, *)) {
UITabBarAppearance * barAppearance = [UITabBarAppearance new];
barAppearance.backgroundEffect = nil;
barAppearance.backgroundImage = [UIImage imageWithColor:kWhiteColor];
self.tabBar.scrollEdgeAppearance = barAppearance;
self.tabBar.standardAppearance = barAppearance;
}
kWhiteColor:是自定义的颜色,可以写成你需要的颜色或图片
3.UITableView新增属性
if (@available(iOS 15.0, *)) {
self.tableView.sectionHeaderTopPadding = 0;
}
4.项目不能run,提示这个错误:
: The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.
翻译(:旧版构建系统将在未来版本中删除。 您可以在文件 > 工作区设置中配置选定的构建系统和此弃用消息。)


5.发现多个名为“name”的方法的结果、参数类型或属性不匹配
Multiple methods named 'name' found with mismatched result, parameter type or attributes
(先把数组dataArray中的模型model取出来,然后再去模型model里的属性"name")
网友评论