[TIMOB-24854] iOS: tintColor doesn't work on iOS simulator
GitHub Issue
n/a
Type
Bug
Priority
High
Status
Closed
Resolution
Not Our Bug
Resolution Date
2017-06-20T12:12:58.000+0000
Affected Version/s
n/a
Fix Version/s
n/a
Components
n/a
Labels
n/a
Reporter
ILAY SENER
Assignee
Unknown
Created
2017-06-20T03:33:54.000+0000
Updated
2018-08-06T17:52:09.000+0000
Description
tintColor doesn't work from Alloy (yet to test from Titanium) unless the styling parameters are in the following sequence:
image="/images/ic_clear_white.png" bubbleParent="false" backgroundColor="transparent" tintColor="#01A92A"
if the sequence is different, tintColor doesn't work.
To replicate:
1) create alloy app
2) add following to index.xml
3) test it
I have attached the png image and a screen-grab of the app
The tintColor is only applied when you use the system button-styles (default). As soon as you pass custom style parameters, e.g. color or backgroundColor, Titanium will choose the correct button-style, which is custom. In that style, the tintColor is not honored and is set with the color property. Note that the system-buttons will "fade" the click to indicate a press-state, for custom-styled buttons, you have to configure that by yourself.
*Resolving as _Not our Bug_*
ILAY SENER 2017-06-21
Hi Hans,
In this case, should this be documented in the docs?
Myself, like many other developers out there, are not experts on both iOS and Android. It is normal for one to assume that the tint should also work in iOS as it does in Android.
Hans Knöchel 2017-06-21
Agree, I actually discovered this behavior only a few months ago while fixing a different button-related issue. We should add a paragraph to the Ti.UI.Button.tintColor property. There actually are docs "[iOS Platform Notes](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Button-property-color)" that mention the behavior, but they may be overseen and should similarly be added to the tintColor ones as well. What do you think?
ILAY SENER 2017-06-21
Hi Hans,
While I agree, I am not sure if we are talking about the same thing. What I am raising is not being able to use "tintColor" on an "imageview" in iOS. It is the "X" in the screengrab.
If you remove backgroundColor or bubbleParent, tintColor will fail. Also fails if you change the order of the parameters.
Are we on the same page???
Eric Merriman 2018-08-06
Closing as "not our bug". If you disagree, please reopen.
The
tintColor
is only applied when you use thesystem
button-styles (default). As soon as you pass custom style parameters, e.g.color
orbackgroundColor
, Titanium will choose the correct button-style, which iscustom
. In that style, thetintColor
is not honored and is set with thecolor
property. Note that the system-buttons will "fade" the click to indicate a press-state, for custom-styled buttons, you have to configure that by yourself. *Resolving as _Not our Bug_*Hi Hans, In this case, should this be documented in the docs? Myself, like many other developers out there, are not experts on both iOS and Android. It is normal for one to assume that the tint should also work in iOS as it does in Android.
Agree, I actually discovered this behavior only a few months ago while fixing a different button-related issue. We should add a paragraph to the Ti.UI.Button.tintColor property. There actually are docs "[iOS Platform Notes](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Button-property-color)" that mention the behavior, but they may be overseen and should similarly be added to the tintColor ones as well. What do you think?
Hi Hans, While I agree, I am not sure if we are talking about the same thing. What I am raising is not being able to use "tintColor" on an "imageview" in iOS. It is the "X" in the screengrab.
Closing as "not our bug". If you disagree, please reopen.