eggswift / ESTabBarController

:octocat: ESTabBarController is a Swift model for customize UI, badge and adding animation to tabbar items. Support lottie!
MIT License
5.17k stars 578 forks source link

tabbar和Navigationbar同时存在的时候使用Lottie不显示 #232

Closed zjinhu closed 1 year ago

zjinhu commented 4 years ago
    let tabBarController = ESTabBarController()

    let v1 = HabitVC()
    let v2 = CountDownVC()
    let v3 = MineVC()

    v1.tabBarItem = ESTabBarItem.init(BaseContentView(), title: nil, image: UIImage(named: "tab_home_nor"), selectedImage: UIImage(named: "tab_home_hi"))
    v2.tabBarItem = ESTabBarItem.init(BaseContentView(), title: nil, image: UIImage(named: "tab_chat_nor"), selectedImage: UIImage(named: "tab_chat_hi"))
    v3.tabBarItem = ESTabBarItem.init(LottieContentView(), title: nil, image: nil, selectedImage: nil)

    let nav1 = UINavigationController.init(rootViewController: v1)
    let nav2 = UINavigationController.init(rootViewController: v2)
    let nav3 = UINavigationController.init(rootViewController: v3)

    tabBarController.viewControllers = [nav1, nav2, nav3]

    return tabBarController

这样Lottie就不显示了

zjinhu commented 4 years ago

补充一下,要是给LottieContentView的image设置一张图片的话可以显示动画和图片重叠,不添加图片就是空白的