S
S
Sunset_over2015-11-09 09:48:09
Objective-C
Sunset_over, 2015-11-09 09:48:09

How to change icons dynamically in UITabBarController?

Good afternoon, I need to change the icons in the UITabBarController while in applications, without restarting.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Marunko, 2015-11-09
@Antonio-banderas

UIImage * selectedImage = [UIImage imageNamed:@"icon_selected.png"];
UIImage * unselectedImage = [UIImage imageNamed:@"icon_unselected.png"];
UITabBarItem * item = ((UITabBarController*)([tabBarController.viewControllers objectAtIndex:index])).tabBarItem;
[item setImage:unselectedImage];
[item setSelectedImage:selectedImage];
won't fit?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question