Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

upd tabBarControler: add ability to modificate tabbar button titles

  • Loading branch information...
commit ebc91b8cb29cea9d6cb8c408ec56247a5540f5cc 1 parent d855811
@Malaar authored
View
2  MUKit/MUControllers/MUTabBarController.h
@@ -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
View
8 MUKit/MUControllers/MUTabBarController.m
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.