Skip to content

Commit

Permalink
Merge pull request #8089 from hansemannn/TIMOB-23566
Browse files Browse the repository at this point in the history
[TIMOB-23566] iOS: Support global tintColor that inherits to child-views
  • Loading branch information
AngelkPetkov committed Jun 28, 2016
2 parents 30cd153 + 6844f2b commit a24ab8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
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 by the child views and can be
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

0 comments on commit a24ab8a

Please sign in to comment.