{ "id": "102660", "key": "TIMOB-11873", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-05-02T22:16:07.000+0000", "created": "2012-10-04T15:37:50.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" }, { "id": "14613", "description": "Release 2.1.4", "name": "Release 2.1.4", "archived": true, "released": true, "releaseDate": "2012-11-12" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-02T22:16:07.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Actual result*\r\nAdding a label to a button, with a color and highlightedColor will initially work, and show the highlightedColor on press. But on release it remains in the highlightedColor, and does not revert back to the color. If you press and drag off the button, you can sometimes get the color back.\r\n\r\n*Test case*\r\nThis is reproducible in the kitchen sink example of custom label button. (Once pressed the label stays green and does not revert back to red).\r\n\r\n*Workaround*\r\nIt looks like something changed in iOS 6 with the event cycle for the button.\r\nIn TiUIButton : - (void)controlAction:(id)sender forEvent:(UIEvent *)event\r\n\r\nIt sets the highlighted state of child views to button.highlighted.\r\nHowever, in this controlAction method, button.highlighted appears to always be true, regardless of \r\nthe touch.phase. So the label will never be told to to remove its highlighted state.\r\n\r\nI fixed this by manually setting the state on child views:\r\n\r\n{code:java} \r\n//Manually set highlighted as button.highlighed is always true in ios6 at this point in the event cycle\r\n switch (touch.phase) {\r\n case UITouchPhaseBegan:\r\n if (touchStarted) {\r\n return;\r\n }\r\n touchStarted = YES;\r\n fireEvent = @\"touchstart\";\r\n [self setHighlighting:true]; //Manually set highlight\r\n break;\r\n case UITouchPhaseMoved:\r\n fireEvent = @\"touchmove\";\r\n break;\r\n case UITouchPhaseEnded:\r\n touchStarted = NO;\r\n fireEvent = @\"touchend\";\r\n \r\n if (button.highlighted) { //This is always true now so this might need to move?\r\n fireActionEvent = [touch tapCount] < 2 ? @\"click\" : @\"dblclick\";\r\n }\r\n [self setHighlighting:false]; //Manually set highlight\r\n break;\r\n case UITouchPhaseCancelled:\r\n touchStarted = NO;\r\n fireEvent = @\"touchcancel\";\r\n [self setHighlighting:false]; //Manually set highlight\r\n break;\r\n default:\r\n return;\r\n }\r\n \r\n // this appears to alwasy set to true, so manually set above\r\n // [self setHighlighting:button.highlighted];\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: Custom Label in Button stays in highlightedColor state once button is released.", "creator": { "name": "mattbryson", "key": "mattbryson", "displayName": "Matt Bryson", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "mattbryson", "key": "mattbryson", "displayName": "Matt Bryson", "active": true, "timeZone": "Europe/London" }, "environment": "OSX\r\nXcode 4.5\r\nIOS 6\r\nTi SDK 2.1.3_GA", "comment": { "comments": [ { "id": "228749", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed the Kitchen Sink issue on iOS 5.1 Ti SDK 2.1.3 GA, 2.1.4 GA and latest 3.0.0 CI. Description mentions a change in iOS 6, but this happens on iOS 5.1 too...", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-28T00:27:49.000+0000", "updated": "2012-11-28T00:27:49.000+0000" }, { "id": "418966", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-02T22:16:07.000+0000", "updated": "2017-05-02T22:16:07.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }