{ "id": "127041", "key": "AC-1009", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-03-12T05:23:13.000+0000", "created": "2014-03-03T19:03:41.000+0000", "labels": [ "attributedString", "listview" ], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:20.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "*Overview*\r\nI would like to use the attributedString property to apply styling to a specific range of text inside a label but there is a context problem\r\n\r\n*Steps to Reproduce*\r\nUse the code below to create a ListView and apply a TiUIiOSAttributedString to the attributedString property of the label via the binded id\r\n\r\n{code:xml|title=view|borderStyle=solid}\r\n...\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n...\r\n{code}\r\n{code:js|title=controller|borderStyle=solid}\r\nvar snippet = \"Test string\";\r\nvar formatter = Titanium.UI.iOS.createAttributedString({\r\n text : snippet,\r\n attributes : [{\r\n type : Titanium.UI.iOS.ATTRIBUTE_BACKGROUND_COLOR,\r\n value : 'yellow',\r\n range : [0, 4]\r\n }]\r\n});\r\n\r\nvar item = {\r\n snippet : {\r\n text : snippet,\r\n attributedString : formatter\r\n },\r\n properties : {\r\n height : Ti.UI.SIZE,\r\n accessoryType : 1,\r\n itemId : 0,\r\n },\r\n};\r\n\r\n$.section.appendItems([item]);\r\n{code}\r\n\r\n\r\n\r\n*Observed Behavior*\r\nThe attributed string is ignored and a WARN is generated in the console that reads\r\n{code}\r\n[WARN] : Creating [object TiUIiOSAttributedString] in a different context than the calling function.\r\n{code}\r\n\r\n\r\n\r\n*Expected Behavior*\r\nThe example allows me to style the listitem's label showing \"Test string\" with \"Test\" atop a yellow background.", "attachment": [], "flagged": false, "summary": "ListView does not allow attributedString to be set on label ", "creator": { "name": "jerodfritz", "key": "jerodfritz", "displayName": "Jerod Fritz", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jerodfritz", "key": "jerodfritz", "displayName": "Jerod Fritz", "active": true, "timeZone": "America/New_York" }, "environment": "iPhone Simulator iOS 7.0\r\nSDK 3.2.1 GA", "comment": { "comments": [ { "id": "296691", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you please attach the runnable code so that we can try to reproduce the issue?", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-11T23:00:29.000+0000", "updated": "2014-03-11T23:00:29.000+0000" }, { "id": "296694", "author": { "name": "jerodfritz", "key": "jerodfritz", "displayName": "Jerod Fritz", "active": true, "timeZone": "America/New_York" }, "body": "Ritu,\n\nIn creating the fully runnable code I was unable to reproduce so my context issue must be something I'm doing. My test code uses the attributedString fine. Apologies for not doing that first. \n\nPlease close this ticket as invalid.\n\nThanks,\nJerod", "updateAuthor": { "name": "jerodfritz", "key": "jerodfritz", "displayName": "Jerod Fritz", "active": true, "timeZone": "America/New_York" }, "created": "2014-03-11T23:34:52.000+0000", "updated": "2014-03-11T23:34:52.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }