UIImage *BGImage = [UIImage imageNamed:@""];
UIImage *shadowImage = [UIImage imageNamed:@""];
[UIView transitionWithView:tabBarController.tabBar duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
//针对ios13 进行设置
if (@available(iOS 13.0, *)) {
UITabBarAppearance *appearance = [tabBarController.tabBar.standardAppearance copy];
appearance.backgroundImage = BGImage;
appearance.shadowImage = shadowImage;
tabBarController.tabBar.standardAppearance = appearance;
} else {
tabBarController.tabBar.backgroundImage = BGImage;
tabBarController.tabBar.shadowImage = shadowImage;
}
} completion:NULL];
iOS13-设置tabbar shadowImage 失效。
最新推荐文章于 2020-12-21 12:34:29 发布