Permalink
Browse files

upd tabBarControler: add ability to modificate tabbar button titles

  • Loading branch information...
1 parent d855811 commit ebc91b8cb29cea9d6cb8c408ec56247a5540f5cc @Malaar committed Nov 11, 2012
Showing with 10 additions and 0 deletions.
  1. +2 −0 MUKit/MUControllers/MUTabBarController.h
  2. +8 −0 MUKit/MUControllers/MUTabBarController.m
@@ -86,6 +86,8 @@ typedef enum MUTabBarControllerStyle
- (void) configureTabBarButton:(UIButton*)aTabBarButton atIndex:(NSUInteger)anIndex; ///< Override to customize tabBarItem
- (CGFloat) spaceBeforeTabBarButtonAtIndex:(NSUInteger)anIndex; ///< Override to configure additional space
+- (void)updateTabBarButtonTitle:(NSString*)aTabBarButtonTitle forTabBarAtIndex:(NSUInteger)aTabBarButtonIndex;
+
@end
@@ -365,6 +365,7 @@ - (void) setupControllers
// create tabBar button and configure
UIButton* button = [self createTabBarButtonAtIndex:tabBarButtonIndex];
button.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
+
[button setTitle:tabBarItem.title forState:UIControlStateNormal];
[button setTitleColor:tabBarItem.titleColor forState:UIControlStateNormal];
[button setTitleShadowColor:tabBarItem.titleShadowColor forState:UIControlStateNormal];
@@ -491,6 +492,13 @@ - (void) updateTabArrow
}
+//==============================================================================
+- (void)updateTabBarButtonTitle:(NSString*)aTabBarButtonTitle forTabBarAtIndex:(NSUInteger)aTabBarButtonIndex
+{
+ UIButton* button = [tabBar.buttons objectAtIndex:aTabBarButtonIndex];
+ [button setTitle:aTabBarButtonTitle forState:UIControlStateNormal];
+}
+
#pragma mark - MUTabedToolbarDelegate
//==============================================================================
- (BOOL) tabedToolbar:(MUTabedToolbar *)aTabBar shouldSelectItemAtIndex:(NSUInteger)anIndex

0 comments on commit ebc91b8

Please sign in to comment.