diff --git a/iphone/Classes/TiUIWindowProxy.m b/iphone/Classes/TiUIWindowProxy.m index ae0a37b53b3..8b6a7bb6535 100644 --- a/iphone/Classes/TiUIWindowProxy.m +++ b/iphone/Classes/TiUIWindowProxy.m @@ -126,6 +126,7 @@ -(void)_destroy -(void)_configure { [self replaceValue:nil forKey:@"barColor" notification:NO]; + [self replaceValue:nil forKey:@"navTintColor" notification:NO]; [self replaceValue:nil forKey:@"barImage" notification:NO]; [self replaceValue:nil forKey:@"translucent" notification:NO]; [self replaceValue:NUMBOOL(NO) forKey:@"tabBarHidden" notification:NO]; @@ -334,6 +335,23 @@ -(void)hideNavBar:(NSArray*)args } } +-(void)setNavTintColor:(id)colorString +{ + if (![TiUtils isIOS7OrGreater]) { + [self replaceValue:[TiUtils stringValue:colorString] forKey:@"navTintColor" notification:NO]; + return; + } + ENSURE_UI_THREAD(setNavTintColor,colorString); + NSString *color = [TiUtils stringValue:colorString]; + [self replaceValue:color forKey:@"navTintColor" notification:NO]; + if (controller!=nil) { + TiColor * newColor = [TiUtils colorValue:color]; + UINavigationBar * navBar = [[controller navigationController] navigationBar]; + [navBar setTintColor:[newColor color]]; + [self performSelector:@selector(refreshBackButton) withObject:nil afterDelay:0.0]; + } +} + -(void)setBarColor:(id)colorString { ENSURE_UI_THREAD(setBarColor,colorString); @@ -821,6 +839,7 @@ -(void)setupWindowDecorations SETPROP(@"titlePrompt",setTitlePrompt); [self updateTitleView]; SETPROP(@"barColor",setBarColor); + SETPROP(@"navTintColor",setNavTintColor); SETPROP(@"translucent",setTranslucent); SETPROP(@"tabBarHidden",setTabBarHidden); SETPROPOBJ(@"leftNavButton",setLeftNavButton); diff --git a/iphone/Classes/TiUtils.m b/iphone/Classes/TiUtils.m index 87b8e78505c..97174896df4 100644 --- a/iphone/Classes/TiUtils.m +++ b/iphone/Classes/TiUtils.m @@ -1452,7 +1452,8 @@ +(void)applyColor:(TiColor *)color toNavigationController:(UINavigationControlle } else { [navBar setTintColor:barColor]; } - + + //This should not be here but in setToolBar. But keeping in place. Clean in 3.2.0 UIToolbar * toolBar = [navController toolbar]; [toolBar setBarStyle:barStyle]; [toolBar setTranslucent:isTranslucent];