{ "id": "121906", "key": "TIMOB-15624", "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": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2013-10-31T20:59:51.000+0000", "created": "2013-10-31T18:06:19.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-3.2.0", "qe-nfc" ], "versions": [], "issuelinks": [ { "id": "32970", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "115954", "key": "TIMOB-14235", "fields": { "summary": "iOS: Support NSAttributedString", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-13T21:34:15.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": "*Details:* Shadow attribute does not appear with the underline attribute for a label text.\r\n\r\n*Steps to reproduce:*\r\n1. Install the following app.js code to device:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#ddd',\r\n});\r\n \r\nwin.open();\r\n \r\nvar text = 'Bacon ipsum dolor sit amet fatback leberkas salami sausage tongue strip steak. Andouille drumstick meatball boudin shank flank sausage, ribeye ham venison doner bacon ham hock. Appcelerator Titanium sucks rocks! Filet mignon ham pancetta, tail salami pork chop short ribs leberkas kielbasa t-bone tri-tip bresaola. Kevin beef ribs tail hamburger andouille filet mignon bresaola ham ham hock flank meatball pork chop corned beef';\r\n \r\nvar attr = Ti.UI.iOS.createAttributedString({\r\n text: text,\r\n attributes: [\r\n \r\n // Underlines text\r\n // Comment this out to see shadow\r\n {\r\n type: Ti.UI.iOS.ATTRIBUTE_UNDERLINES_TYLE,\r\n value: Ti.UI.iOS.ATTRIBUTE_UNDERLINE_STYLE_SINGLE | Ti.UI.iOS.ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT,\r\n range: [0, text.length]\r\n },\r\n \r\n // Sets a background color\r\n {\r\n type: Ti.UI.iOS.ATTRIBUTE_BACKGROUND_COLOR,\r\n value: \"blue\",\r\n range: [text.indexOf('Titanium'), ('Titanium').length]\r\n },\r\n // Sets a foreground color\r\n {\r\n type: Ti.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,\r\n value: \"white\",\r\n range: [0, text.length]\r\n },\r\n // Sets a background color\r\n {\r\n type: Ti.UI.iOS.ATTRIBUTE_BACKGROUND_COLOR,\r\n value: \"yellow\",\r\n range: [text.indexOf('rocks!'), ('rocks!').length]\r\n },\r\n // Sets a foreground color\r\n {\r\n type: Ti.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,\r\n value: \"black\",\r\n range: [text.indexOf('rocks!'), ('rocks!').length]\r\n },\r\n // Crossed out text\r\n {\r\n type: Ti.UI.iOS.ATTRIBUTE_STRIKETHROUGH_STYLE,\r\n value: Ti.UI.iOS.ATTRIBUTE_UNDERLINE_STYLE_SINGLE,\r\n range: [text.indexOf('sucks'), ('sucks').length]\r\n },\r\n \r\n // Creates a shadow\r\n {\r\n type: Ti.UI.iOS.ATTRIBUTE_SHADOW,\r\n value: {\r\n offset: {\r\n width: 10,\r\n height: 5\r\n },\r\n blurRadius: 1,\r\n color: 'green'\r\n },\r\n range: [text.indexOf('Appcelerator'), ('Appcelerator').length]\r\n }\r\n ]\r\n});\r\n \r\nvar label = Ti.UI.createLabel({\r\n left: 20,\r\n right: 20,\r\n height: Ti.UI.SIZE,\r\n backgroundColor: 'red',\r\n attributedString: attr\r\n});\r\n \r\nwin.add(label);\r\n{code}\r\n\r\n*Actual:* A green shadow does not appear behind \"Appcelerator\" (see no_shadow.png).\r\n\r\n*Expected:* A green shadow should appear behind \"Appcelerator\" (see shadow.png).", "attachment": [ { "id": "43580", "filename": "no_shadow.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-10-31T18:06:19.000+0000", "size": 96494, "mimeType": "image/png" }, { "id": "43581", "filename": "shadow.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-10-31T18:06:19.000+0000", "size": 103492, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: AttributedString - Shadow attribute does not appear with the underline attribute for a label text", "creator": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio, build: 3.2.0.201310310121\r\nSDK build: 3.2.0.v20131030184044\r\nDevice: iphone 4s (6.0.1), iphone 5s (7.0.2)\r\nXcode: 5.0\r\n", "comment": { "comments": [ { "id": "277570", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Tested this in native Object-C app and can reproduce as well. This seems to be an Apple bug. Tested on iOS 7\r\n\r\nNote:\r\nIf the underline style is removed, then the shadow is visible. \r\n{code}\r\n- (void)viewDidLoad\r\n{\r\n [super viewDidLoad];\r\n [[self view] setBackgroundColor:[UIColor lightGrayColor]];\r\n \r\n NSString *text = @\"Bacon ipsum dolor sit amet fatback leberkas salami sausage tongue strip steak. Andouille drumstick meatball boudin shank flank sausage, ribeye ham venison doner bacon ham hock. Appcelerator Titanium sucks rocks! Filet mignon ham pancetta, tail salami pork chop short ribs leberkas kielbasa t-bone tri-tip bresaola. Kevin beef ribs tail hamburger andouille filet mignon bresaola ham ham hock flank meatball pork chop corned beef\";\r\n\r\n UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 280, 500)];\r\n\r\n [label setNumberOfLines:0];\r\n [label setBackgroundColor:[UIColor redColor]];\r\n\r\n NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text];\r\n \r\n [attr addAttribute: NSUnderlineStyleAttributeName\r\n value: [NSNumber numberWithInteger:NSUnderlineStyleSingle | NSUnderlinePatternDashDotDot]\r\n range: NSMakeRange(0, [text length])\r\n ];\r\n\r\n [attr addAttribute: NSBackgroundColorAttributeName\r\n value: [UIColor blueColor]\r\n range: [text rangeOfString:@\"Titanium\"]\r\n ];\r\n\r\n [attr addAttribute: NSForegroundColorAttributeName\r\n value: [UIColor whiteColor]\r\n range: NSMakeRange(0, [text length])\r\n ];\r\n\r\n [attr addAttribute: NSBackgroundColorAttributeName\r\n value: [UIColor yellowColor]\r\n range: [text rangeOfString:@\"rocks!\"]\r\n ];\r\n [attr addAttribute: NSForegroundColorAttributeName\r\n value: [UIColor blackColor]\r\n range: [text rangeOfString:@\"rocks!\"]\r\n ];\r\n [attr addAttribute: NSStrikethroughStyleAttributeName\r\n value: [NSNumber numberWithInteger:NSUnderlineStyleSingle]\r\n range: [text rangeOfString:@\"sucks\"]\r\n ];\r\n \r\n NSShadow *shadow = [[NSShadow alloc] init];\r\n [shadow setShadowOffset:CGSizeMake(10, 5)];\r\n [shadow setShadowBlurRadius:1];\r\n [shadow setShadowColor:[UIColor greenColor]];\r\n [attr addAttribute: NSShadowAttributeName\r\n value: shadow\r\n range: [text rangeOfString:@\"Appcelerator\"]\r\n ];\r\n\r\n [label setAttributedText:attr];\r\n \r\n [[self view] addSubview:label];\r\n [label sizeToFit];\r\n}\r\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-10-31T20:59:51.000+0000", "updated": "2013-10-31T20:59:51.000+0000" }, { "id": "411587", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as this is not our bug.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-13T21:34:15.000+0000", "updated": "2017-03-13T21:34:15.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }