[TIMOB-24237] iOS: Add backgroundSelectedColor property (Parity)
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-01-03T15:39:44.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 6.1.0 |
Components | iOS |
Labels | SDK5.5.0, qe-6.1.0 |
Reporter | Pankaj Goyal |
Assignee | Hans Knöchel |
Created | 2016-12-15T07:05:42.000+0000 |
Updated | 2017-01-03T15:40:00.000+0000 |
Description
Hi,
There is no way of setting backgroundSelected Color for ios using Appcelerator. And if i tried to do acheive same by using touchStart and touchEnd Listeners, it sowing some weird behavior. On the tap of left side corner of the device, backgroundSelected color is getting reflected little late. Listeners are getting called, but background color is not changing quickly on iPhone 7 Only.
Please help
Thanks
Pankaj Goyal
Hello, Thanks for the ticket. Can you share with how this is handled in native platform? We will consider your request.
Feature request accepted, it sounds like a good idea for parity. What we can do is adding the property to buttons, where we natively can control the current state. Since iOS natively doesn't support the property, we use a hack to generate an image from the color set the
backgroundSelectedImage
property internally. The performance is great and there are no UI glitches. PR: https://github.com/appcelerator/titanium_mobile/pull/8698 Test-case:CR and FT passed! PR APPROVED!
Discovered a minor issue when testing this improvement: when
backgroundSelectedColor
is present, thetintColor
property no longer affects the color of the button's text. Tested On: iPhone 6 Plus 10.2 Device & Simulator Mac OS Sierra (10.12.2) Ti SDK:6.1.0.v20170101113815 Appc Studio: 4.8.0.201611121409 Appc NPM: 4.2.8 App CLI: 6.1.0-319 Xcode 8.2.1 Node v4.4.7No issue here. When setting the
backgroundColor
,backgroundSelectedColor
orbackgroundImage
property on the button, theUIButtonTypeCustom
button type is used internally. Otherwise, usingUIButtonTypeSystem
(default), the button's background would be half-translucent, which is not usable for the developer. This behavior is there since forever (the last change to that line was in 1.7.0 in 2010). I cleaned this up in [this line](https://github.com/appcelerator/titanium_mobile/pull/8698/files#diff-a555421929ad7fca502ddd144627bdaaR193) but it's still the same behavior.Thanks for clarifying, in that case everything is working as intended, closing ticket.