Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seting animation programmatically does not work #287

Closed
huylv-teko opened this issue Jun 11, 2020 · 2 comments
Closed

Seting animation programmatically does not work #287

huylv-teko opened this issue Jun 11, 2020 · 2 comments

Comments

@huylv-teko
Copy link

huylv-teko commented Jun 11, 2020

Hey, i setup tab like this but the animation does now show. Please help :D Im using iphone11 pro simulator with ios 13.5

class HomeTabBarController: RAMAnimatedTabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let homeTab = HomeViewController.instantiateFromNib()
        homeTab.tabBarItem = RAMAnimatedTabBarItem(tabBarSystemItem: .favorites, tag: 0)
        let storeTab = StoreTabViewController.instantiateFromNib()
        storeTab.tabBarItem = RAMAnimatedTabBarItem(tabBarSystemItem: .contacts, tag: 1)
        let menuTab = MenuTabViewController.instantiateFromNib()
        menuTab.tabBarItem = RAMAnimatedTabBarItem(tabBarSystemItem: .featured, tag: 2)
        let menu2Tab = MenuTabViewController.instantiateFromNib()
        menu2Tab.tabBarItem = RAMAnimatedTabBarItem(tabBarSystemItem: .more, tag: 3)
        viewControllers = [homeTab, storeTab, menuTab, menu2Tab]
        animatedItems[0].animation = RAMLeftRotationAnimation()
        animatedItems[1].animation = RAMLeftRotationAnimation()
        animatedItems[2].animation = RAMLeftRotationAnimation()
        animatedItems[3].animation = RAMLeftRotationAnimation()
    }
}
@igork-ramotion
Copy link
Contributor

@huylv-teko Hey, to work properly RAMAnimatedTabBarItem need UIImage be set. System item will not work. Please use one of this init methods:

public convenience init(title: String?, image: UIImage?, tag: Int)
public convenience init(title: String?, image: UIImage?, selectedImage: UIImage?)

@huylv-teko
Copy link
Author

Yeah thank you, you should add this note to README :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants