{ "id": "62810", "key": "TIMOB-2178", "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": "11239", "name": "Release 1.6.0 M06", "archived": true, "released": true, "releaseDate": "2011-01-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:58:19.000+0000", "created": "2011-04-15T03:12:51.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "defect", "gradient", "ios", "iphone", "release-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:58:19.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}
Running on the iphone, setting a background gradient color to\nblack does not work, Setting it to 000001 does work however.
\nCode:
\nvar win = Ti.UI.currentWindow;
var view = Titanium.UI.createView({
\ntop:0,\nleft:0,\n//height:height,\n//width:width,\nbackgroundGradient:{\n type:'linear',\n colors:[{color:'#50FFFF',position:0.0},{color:'#000000',position:1.0}]\n }
\n
\n});
\nwin.add(view);
\nHD ticket
\nhttp://developer.appcelerator.com/helpdesk/view/51211
Apparently the reason why this isn't working is because [UIColor\nblackColor]'s color space model is\nkCGColorSpaceModelMonochrome.
\nCAGradientLayer does not accept colors that are in the\nkCGColorSpaceMonochrome color space model.
The fix for this is to check if the color space is\nkcGColorSpaceModelMonochrome, and if it is, re-assign the\ngradient's color to the RGB representation of the color by using\nUIColor's colorWithRed:green:blue:alpha: method.
\nHere's a screenshot of it in action:
\n(from [e2c1e33e2196f82f790db9282ce9612fd24e2b75])\n[#2178 state:fixed-in-qa] [#2837\nstate:fixed-in-qa] Updating formatting for TiGradient to house\nstyle. Actual bug fixes were done by Jacob. See https://github.com/appcelerator/titanium_mobile/pull/58\n\nhttps://github.com/appcelerator/titanium_mobile/commit/e2c1e33e2196...
Added test to Integrity, validated fix.