Cuberto / bubble-icon-tabbar

MIT License
1.1k stars 105 forks source link

Unselected images are showing black by default #16

Closed NirajCapermint closed 5 years ago

NirajCapermint commented 5 years ago

Version 0.8.4

It is showing images for unselected like this for the first time (black color).

Screenshot 2019-08-31 at 4 02 04 PM

After I select any other tab item than showing correctly. Any idea what could be the wrong?

Screenshot 2019-08-31 at 4 03 19 PM

askopin commented 5 years ago

how do you init control? from storyboard or manually?

NirajCapermint commented 5 years ago

From storyboard I just assign the class name to tab bar and from code I am using all the things like:

let homeVC = self.storyBoard.instantiateViewController(withIdentifier: SCREENNAME.HOME.rawValue) as! HomeVC
homeVC.tabBarItem = UITabBarItem(title: "Chats", image: #imageLiteral(resourceName: "chat_tab.png"), selectedImage: #imageLiteral(resourceName: "chat_tab_sel.png"))
let tabBarController = BubbleTabBarController()
        tabBarController.viewControllers = [homeVC,roomsVC,storiesVC,profileVC,settingVC]
        tabBarController.tabBar.tintColor = UIColor().tabBarBackgroundColor
        navigationController = UINavigationController(rootViewController: tabBarController)
        navigationController.navigationBar.isHidden = true
        navigationController.navigationBar.barStyle = .black
        navigationController.interactivePopGestureRecognizer?.isEnabled = true
        appDelegate.window?.rootViewController = navigationController
askopin commented 5 years ago

first of all, update the lib, I fixed rendering mode behaviour - now it respects rendering mode of both selected and unselected images on the other hand, if you want to use image with original rendering mode, you should do it explicitly by calling method .withRenderingMode(.alwaysOriginal) of UIImage

NirajCapermint commented 5 years ago

I am already using latest version of library and regarding your suggestion of using method of UIImage withRenderingMode(.alwaysOriginal), I already tried that way and nothing works.

askopin commented 5 years ago

let's check, the latest binary is 0.8.5? If it is not - pod install --repo-update If it is - check sample from branch 'test/original-image-sample' it contains one tab with nontemplate image an it works for me

NirajCapermint commented 5 years ago

@askopin Yes, 0.8.5

askopin commented 5 years ago

@NirajCapermint did you check sample?