{ "id": "91703", "key": "TIMOB-9094", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "2012-05-10T10:05:10.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api" ], "versions": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:27.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": "UILabel class in iOS has a property called \"lineBreakMode\" which can be used for wrapping and truncating the label's text.\r\n\r\nCurrently, in Titanium, when the label's text exceeds its width, the text gets truncated at the end.\r\n\r\nPlease expose this property to JS so that users could truncate it as per their choice.\r\n\r\nHere are the links from Apple's documentation.\r\n\r\n*UILabel Reference*\r\n[http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UILabel_Class/Reference/UILabel.html]\r\n\r\n*UILineBreakMode options*\r\n[http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/NSString_UIKit_Additions/Reference/Reference.html#//apple_ref/doc/c_ref/UILineBreakMode]\r\n\r\n*Test Case*\r\n{noformat}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#FFF\"\r\n});\r\n\r\nvar lbl = Ti.UI.createLabel({\r\n lineBreakMode :\"headTruncation\",\r\n // lineBreakMode: \"middleTruncation\",\r\n // lineBreakMode: \"wordWrap\",\r\n // lineBreakMode: \"characterWrap\",\r\n // lineBreakMode: \"clip\",\r\n text: \"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\r\n width: 300,\r\n height: 30 \r\n});\r\n\r\nwin.add(lbl);\r\nwin.open();\r\n{noformat}", "attachment": [], "flagged": false, "summary": "iOS: Expose lineBreakMode property on TiUILabel", "creator": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Product: Titanium Mobile\r\nTitanium SDK: 2.0.1 GA2\r\nHost OS: Mac OS X Lion\r\nPlatform OS: iOS\r\nPlatform OS Version: 5.0, 5.1", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }