当前位置: 代码迷 >> 综合 >> iOS13-设置tabbar shadowImage 失效。
  详细解决方案

iOS13-设置tabbar shadowImage 失效。

热度:43   发布时间:2023-12-18 12:06:03.0
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];
  相关解决方案