{ "id": "134456", "key": "AC-1544", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-10-28T08:26:27.000+0000", "created": "2014-08-09T20:04:14.000+0000", "labels": [ "TCSupportTriage", "alloy", "ios", "listview" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:38:00.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": "h4. Problem Description\r\nView layout doesn't work and height doesn't work correctly in ListView.\r\nThis is only happening in iOS. See attached index.xml for sample code.\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project (Classic titanium)\r\n2. Add this code to app.js: \r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\nvar template = {\r\n \r\n properties: {\r\n height: \"80dp\"\r\n },\r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.View',\r\n bindId: 'article',\r\n id: 'article',\r\n properties: {\r\n layout: 'vertical',\r\n backgroundColor: \"#EEE\"\r\n },\r\n \r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.Label',\r\n bindId: 'articleTitle',\r\n id: 'articleTitle',\r\n properties: {\r\n text: \"Cars exploding in drag races look like they are made out of Jell-O\",\r\n wordWrap: true,\r\n },\r\n \r\n },\r\n {\r\n type: 'Ti.UI.Label',\r\n bindId: 'Title',\r\n id: 'Title',\r\n properties: {\r\n text: \"Gizmodo\",\r\n },\r\n \r\n },\r\n ]\r\n \r\n },\r\n ]\r\n \r\n}; \r\n \r\n \r\n \r\nvar listView = Ti.UI.createListView({\r\n templates: { 'template': template }, \r\n defaultItemTemplate: 'template',\r\n separatorColor: \"#000000\"\r\n \r\n});\r\n \r\n \r\n \r\nvar sections = [];\r\n \r\n \r\nvar listSection = Ti.UI.createListSection({\r\n id: 'myListSection'\r\n});\r\n \r\nvar listDataSet = [\r\n \r\n { article: 'article' },\r\n { article: 'article' },\r\n { article: 'article' },\r\n { article: 'article' },\r\n { article: 'article' },\r\n { article: 'article' },\r\n { article: 'article' },\r\n \r\n \r\n];\r\nlistSection.setItems(listDataSet);\r\nsections.push(listSection);\r\n \r\nlistView.setSections(sections);\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n4. Run it in device. ", "attachment": [ { "id": "50352", "filename": "index.js", "author": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-10T05:28:40.000+0000", "size": 221, "mimeType": "text/javascript" }, { "id": "50350", "filename": "index.xml", "author": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-09T20:06:13.000+0000", "size": 581, "mimeType": "text/xml" }, { "id": "50349", "filename": "Screen Shot 2014-08-09 at 3.05.00 PM.png", "author": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-09T20:06:13.000+0000", "size": 47644, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: View layout and height doesn't work correctly in ListView ", "creator": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK ver 3.3.0 GA \r\nAlloy ver. 1.4.1 \r\n", "comment": { "comments": [ { "id": "317970", "author": { "name": "FrancoisM", "key": "francoism", "displayName": "François Mériaux", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The height you set for each row ('150dp') is too small to contain the two labels. Set the height of both the view and the template to Ti.UI.SIZE to have the expected behavior. \r\n\r\n{code:javascript}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n \t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}", "updateAuthor": { "name": "FrancoisM", "key": "francoism", "displayName": "François Mériaux", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-11T15:34:44.000+0000", "updated": "2014-08-11T15:34:44.000+0000" }, { "id": "317985", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello [~handitan]! \r\n\r\nCan you please take a look to the [~FrancoisM] suggestion?\r\n\r\nThanks!", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-08-11T16:20:54.000+0000", "updated": "2014-08-11T16:20:54.000+0000" }, { "id": "318001", "author": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Francois, thank you for your suggestion. I didn't realize that I could set the height for ItemTemplate hmm...\r\nI am trying it with fixed height number and it also works well now.\r\n\r\nThank you!\r\n\r\nThank you Mauro for the follow up.", "updateAuthor": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-11T17:07:03.000+0000", "updated": "2014-08-11T17:07:03.000+0000" }, { "id": "318033", "author": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "body": "François Mériaux :\r\nActually, I think I might spoke too soon.\r\nIs setting the height in itemTemplate the correct way? I don't think I see it in the documentation.\r\nBecause itemTemplate without height being defined works well with Android but not in iOS.", "updateAuthor": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-11T18:29:00.000+0000", "updated": "2014-08-11T18:29:00.000+0000" }, { "id": "318086", "author": { "name": "FrancoisM", "key": "francoism", "displayName": "François Mériaux", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "FrancoisM", "key": "francoism", "displayName": "François Mériaux", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-11T22:07:01.000+0000", "updated": "2014-08-11T22:08:11.000+0000" }, { "id": "318091", "author": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ah ok, thanks Francois.\r\nSo... I guess setting the height in itemTemplate is a must to get it working.\r\n\r\nIt's just misleading to have without-height-itemTemplate works on Android but doesn't work on iOS.\r\n\r\nOh well...", "updateAuthor": { "name": "handitan", "key": "handitan", "displayName": "Handinata Tanudjaja", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-11T22:19:52.000+0000", "updated": "2014-08-11T22:19:52.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }