{ "id": "114632", "key": "TIMOB-13915", "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": null, "resolutiondate": null, "created": "2013-05-20T14:25:42.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ios", "parity" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:37.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. problem\r\n\r\nWhen setting a {{backgroundGradient}} for a view in iOS, the property applies properly, but trying to access the property or print it returns an empty object. On Android or Mobileweb if I attempt to {{JSON.stringify()}} a view's {{backgroundGradient}} property, I get all the values associated with the property as expected. If I do the same on iOS, I get only an empty object. {{\\{\\}}}.\r\n\r\nWhile not critical, this makes it impossible for me to perform runtime testing to assert that Alloy is applying styles correctly when {{backgroundGradient}} is being used on iOS. This makes it particularly tricky if there is a platform-specific style for iOS that includes a gradient.\r\n\r\nh2. expected\r\n\r\nLike Android and Mobileweb, if I perform {{JSON.stringify(someView.backgroundGradient)}} I would like to be able to see the stringified property, not just an empty object.\r\n\r\nh2. test case\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundGradient: {\r\n type: \"linear\",\r\n startPoint: {\r\n x: \"0%\",\r\n y: \"0%\"\r\n },\r\n endPoint: {\r\n x: \"0%\",\r\n y: \"100%\"\r\n },\r\n colors: [ \"#7de36e\", \"#1e8010\" ]\r\n }\r\n});\r\n\r\nTi.API.info(JSON.stringify(win.backgroundGradient));\r\n\r\nwin.open();\r\n{code}\r\n\r\nOn iOS this will print only an empty object, on Android and Mobileweb it will be:\r\n\r\n{code}\r\n{\"type\":\"linear\",\"startPoint\":{\"x\":\"0%\",\"y\":\"0%\"},\"endPoint\":{\"x\":\"0%\",\"y\":\"100%\"},\"colors\":[\"#7de36e\",\"#1e8010\"]}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: backgroundGradient property appears as empty object in Javascript", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.1.0.GA\r\nTiStudio 3.1.2\r\niOS 6.1", "comment": { "comments": [ { "id": "300111", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To fix, we'd have to refactor the code to use properties as opposed to private variables.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-07T21:27:21.000+0000", "updated": "2014-04-07T21:27:21.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }