if(@available(iOS13.0, *)) {UITabBarAppearance* tabbarAppearance =self.standardAppearance; tabbarAppearance.backgroundImage = [UIImageimageWithColor:[UIColorclearColor]]; tabbarAppearance.shadowImage = [UIImageimageWithColor:[UIColorclearColor]];self.standardAppearance = tabbarAppearance; }else{self.backgroundImage = [UIImagenew];self.shadowImage = [UIImagenew]; }```
其中self是自定义的Tabbar,imageWithColor是为UIImage写的一个分类方法:根据颜色生成一张图片,其中 [UIImage new] 方法已不在适用。