{ "id": "62359", "key": "TIMOB-1727", "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": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11249", "name": "Sprint 2011-14", "archived": true, "released": true, "releaseDate": "2011-04-11" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T03:00:42.000+0000", "created": "2011-04-15T03:00:39.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "backgroundcolor", "button", "ios", "klist", "release-1.7.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-28T20:53:22.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": "{html}

This has been a thorn in the side for many (myself included) for\nawhile: See \nhttp://developer.appcelerator.com/questions/search/button%20backgro...

\n

Here's a testcase to reproduce. It doesn't work both if the\nbutton is on the navBar and if it is just in the window. In the\nwindow..the color is set on the edges around the button (which is\nnot what 99.9% of people want I'd think :)

\n
\nvar win = Ti.UI.currentWindow;\n\nvar btn1 = Titanium.UI.createButton({\n    title:\"Test\",\n    backgroundColor:'#0d8d00',\n    width:70,\n});\nwin.rightNavButton = btn1;\n\nvar btn2 = Titanium.UI.createButton({\n    title:\"Test\",\n    backgroundColor:'#0d8d00',\n    width:70,\n    height:120\n});\nwin.add(btn2);\n
\n

Blain: I'm not sure of the ticket triage procedure at\nAppcelerator, so I assigned it to you as it is an iphone related\nbug. If this isn't right, sorry about that. (I just didn't want it\nto langish around.)

{html}", "attachment": [ { "id": "18051", "filename": "screen-shot-2011-04-04-at-1110.png", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:39.000+0000", "size": 122328, "mimeType": "image/png" } ], "flagged": false, "summary": "button backgroundColor does not work", "creator": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "126469", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Oh, one more thing. This was tested with 1.4.0, and with the\n9/2/2010 nightly.

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:39.000+0000", "updated": "2011-04-15T03:00:39.000+0000" }, { "id": "126470", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

And setting backgroundImage: 'none' fixed the main window\nbutton, but not the navbar button. In any case, it's a hack. :)

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:39.000+0000", "updated": "2011-04-15T03:00:39.000+0000" }, { "id": "126471", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Ticket is still valid. Test in bugtests.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:39.000+0000", "updated": "2011-04-15T03:00:39.000+0000" }, { "id": "126472", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Seriously. How has this not been fixed yet? It still doesn't\nwork in 1.6 or the latest nightly 1.6.1

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:40.000+0000", "updated": "2011-04-15T03:00:40.000+0000" }, { "id": "126473", "author": { "name": "norm", "key": "norm", "displayName": "Norm", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Bump for this also - rather silly this doesn't just \"work\" -\nrather core to the way buttons behave.

{html}", "updateAuthor": { "name": "norm", "key": "norm", "displayName": "Norm", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:41.000+0000", "updated": "2011-04-15T03:00:41.000+0000" }, { "id": "126474", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Trying to clarify here: do you mean a rounded rectangle button,\nand how background color defines the corners behind the rounded\nrectangle, and not the rectangle itself? If so, that actually is\nApple's design. Included (And hopefully Lighthouse will actually\nkeep it) is an example outside of Titanium, in Apple's own\nInterface Builder.

\n

In order to have a custom look to a button, you'll have to use a\nbackground image. Take a look at the button example in Kitchen\nSink, namely the section that goes\nTitanium.UI.createButton({backgroundImage:'../images/BUTT_grn_off.png',\nbackgroundSelectedImage:'../images/BUTT_grn_on.png',\nbackgroundDisabledImage: '../images/BUTT_drk_off.png'})\n.

\n

With regards to the nav bar, the class behind that (when no\ncustom background image is used) is UIBarButtonItem. As per\n\nhttp://developer.apple.com/library/ios/#documentation/UIKit/Referen...\n, there's only three styles for a barButtonItem:

\n

Plain: In the nav bar, this is treated as bordered.
\nBordered: The background color is determined by the tint of the\nnavbar containing it. This is not editable.
\nDone: The background color is blue, like a Done button. This color\nis not editable.

\n

Again, for a custom button style, use a backgroundImage.

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:41.000+0000", "updated": "2011-04-15T03:00:41.000+0000" }, { "id": "126475", "author": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Marking as invalid. Blain has explained how to the client can\nimplement custom button UI.

{html}", "updateAuthor": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:42.000+0000", "updated": "2011-04-15T03:00:42.000+0000" }, { "id": "175048", "author": { "name": "dit", "key": "dit", "displayName": "dit k", "active": true, "timeZone": "America/Los_Angeles" }, "body": "setting Image, color etc.. is very buggy and still not fixed :(", "updateAuthor": { "name": "dit", "key": "dit", "displayName": "dit k", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-06T14:11:18.000+0000", "updated": "2011-12-06T14:11:18.000+0000" }, { "id": "416050", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T20:53:22.000+0000", "updated": "2017-03-28T20:53:22.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }