[TIMOB-15436] iOS: Support onTintColor for Ti.UI.Switch
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-04-08T20:35:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2014 Sprint 07, 2014 Sprint 07 SDK, Release 3.3.0 |
Components | iOS |
Labels | module_slider, qe-closed-3.3.0, qe-testadded |
Reporter | Joseph Sachs |
Assignee | Vishal Duggal |
Created | 2013-10-06T21:50:29.000+0000 |
Updated | 2014-04-24T06:57:04.000+0000 |
Description
I manually updated TiUiSwitch.m to have the ability to set the onTintColor of the Ti.UI.Switch component.
A simple Modification:
-(void)setOnTintColor_:(id)color
{
if ([color isKindOfClass:[UIColor class]])
{
[[self switchView] setOnTintColor:color ];
}
else
{
TiColor *ticolor = [TiUtils colorValue:color];
[[self switchView] setOnTintColor: [ticolor _color ] ];
}
}
and in Ti Code:
var aSwitch = Ti.UI.createSwitch({value:true, onTintColor:'#282828'});
and that should do it.
refers to http://developer.appcelerator.com/question/158104/tiuiswitch-ios7-color
at the same time, please consider adding the ThumbTintColor property for a more complete IOS 7 Look and Feel
Bump!
Hi Please add the tintColor as well, and when would we be able to see this released? We have a customer request for this at the moment. Thanks
Hi [~buder], this will likely make it into the next patch release after 3.2.0.
ok, thanks, so the "fix version" is a latest note then? ;) Hope to see it in 3.2.1 then . .
Hi Jörgen, You can implement it manually, as I've mentioned in the current SDK (If you're in a hurry): Go to this file: /Users/
already done, thanks. Was just trying to clarify expectations on my end.
definitely something that would be nice to have added in properly. Thanks for the tip on modifying the switch component as well, much appreciated! :)
Love this! Thanks for the bodge while we wait for it to be implemented in the SDK.
Test Case
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5547
Verified the issue with environment: Appc-Studio:3.3.0.201404211130 sdk:3.3.0.v20140423155715 acs:1.0.14 alloy:1.4.0-dev npm:1.3.2 titanium:3.3.0-dev titanium-code-processor:1.1.1-beta1 xCODE:5.1.1 Device:Iphone5(7.1) onTintColor property working fine on ios. hence closing the issue.