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-23566] iOS: Support global tintColor that inherits to child-views #8089

Merged
merged 2 commits into from
Jun 28, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions apidoc/Titanium/UI/UI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ description: |

On Android, if you want to create a semi-transparent window, set the `opacity`
property **before** opening the window.

On iOS, you can set a global tinting using <Titanium.UI.tintColor>. All child views will inherit
the tint color by default and are able to override the color using `tintColor` on their own views.
The default `tintColor` on iOS is the blue (system-color).

If a color property is undefined, the default color of the particular UI element is applied.
If a color value is not valid on iOS, the default color is applied, whereas, on Android, the
Expand Down Expand Up @@ -2407,6 +2411,14 @@ properties:
type: Number
platforms: [android, iphone, ipad]

- name: tintColor
summary: |
Sets the global tint color of the application. It is inherited to the child views and can be
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to :"It is inherited by the child views"

overwritten by them using the `tintColor` property.
type: String
since: "6.0.0"
platforms: [iphone, ipad]

examples:
- title: Color Demo
example: |
Expand Down
6 changes: 6 additions & 0 deletions iphone/Classes/UIModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ -(void)setBackgroundColor:(id)color
[controller setBackgroundColor:[Webcolor webColorNamed:color]];
}

-(void)setTintColor:(id)color
{
UIWindow *controller = [[[[TiApp app] controller] topWindowProxyView] window];
[controller setTintColor:[Webcolor webColorNamed:color]];
}

-(void)setBackgroundImage:(id)image
{
TiRootViewController *controller = [[TiApp app] controller];
Expand Down