Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timob 9135: Added supported for tabsBackgroundColor for iOS5+ #2538

Merged
merged 4 commits into from
Jul 12, 2012
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions apidoc/Titanium/UI/TabGroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,17 @@ properties:
platforms: [android]

- name: tabsBackgroundColor
summary: Default background color for tabs, as a color name or hex triplet.
summary: Default background color for inactive tabs, as a color name or hex triplet.
description: |
For information about color values, see the "Colors" section of <Titanium.UI>.

A tab's [backgroundColor](Titanium.UI.Tab.backgroundColor) property takes precedence if set.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs need to state that this is supported on IOS version 5.0 or greater

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mobile web the color precedence is tab.backgroundColor, tabGrp.activeTabBackgroundColor, tabGrp.tabsBackgroundColor.
On IOS the backgroundColor applies to all states and all tabs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked with Bryan. The existing description looks good. Will make some modifications regarding iOS.


On iOS, [backgroundColor](Titanium.UI.Tab.backgroundColor) property applies to all states and all tabs, not just inactive tabs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok my mistake. I meant tabsBackgroundColor property applies to all tabs/all states

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of right now the tab.backgroundColor does not work on IOS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok fixed.

type: String
platforms: [mobileweb]
since: {iphone: "2.2.0", ipad: "2.2.0", mobileweb: "1.9.0"}
osver: {ios: {min: "5.0"}}
platforms: [iphone, ipad, mobileweb]

- name: tabsBackgroundImage
summary: Default background image for tabs.
Expand Down
14 changes: 14 additions & 0 deletions iphone/Classes/TiUITabGroup.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,20 @@ - (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizin
}
}

-(void)setTabsBackgroundColor_:(id)value
{
if ([TiUtils isIOS5OrGreater]) {
TiColor* color = [TiUtils colorValue:value];
if (color != nil) {
controller.tabBar.tintColor = color.color;
}

} else {
NSLog(@"[WARN] tabsBackgroundColor is only supported in iOS 5 or above.");
}


}

#pragma mark Public APIs

Expand Down