ChenYilong / CYLTabBarController

[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
MIT License
6.9k stars 1.45k forks source link

[Q-A]使用方法询问:设置的backgroundImage不显示 #579

Closed alexiiio closed 2 years ago

alexiiio commented 2 years ago



My issue:

    self.tabBar.backgroundImage = [UIImage imageNamed:@"666"];

设置backgroundImage不显示,设置0个tabBarItem时显示,设置多个item时就不显示,只是给item设置了图片,用了最基本的代码,其他没做:

  NSDictionary *firstTabBarItemsAttributes = @{
//                                                CYLTabBarItemTitle : @"首页",
                                                CYLTabBarItemImage : @"home_normal",  /* NSString and UIImage are supported*/
                                                CYLTabBarItemSelectedImage : @"home_highlight",  /* NSString and UIImage are supported*/
                                                };
   NSDictionary *secondTabBarItemsAttributes = @{
//                                                 CYLTabBarItemTitle : @"鱼塘",
                                                 CYLTabBarItemImage : @"fishpond_normal",
                                                 CYLTabBarItemSelectedImage : @"fishpond_highlight",
                                                 };
    NSDictionary *thirdTabBarItemsAttributes = @{
 //                                                 CYLTabBarItemTitle : @"鱼塘",
                                                  CYLTabBarItemImage : @"account_normal",
                                                  CYLTabBarItemSelectedImage : @"account_highlight",
                                                  };

求解!