{ "id": "170012", "key": "TIMOB-25390", "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": "2017-10-16T07:57:51.000+0000", "created": "2017-10-13T15:21:34.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-08-06T17:52:09.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": [], "description": "*Test case*\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar mytemplate = {\r\n properties : {\r\n layout : \"horizontal\"\r\n },\r\n childTemplates : [{\r\n type : 'Ti.UI.Button',\r\n bindId : 'btn1',\r\n properties : {\r\n width : 50,\r\n height : 30,\r\n left : 0,\r\n color : \"green\"\r\n }\r\n },{\r\n type : 'Ti.UI.Button',\r\n bindId : 'btn2',\r\n properties : {\r\n width : 50,\r\n height : 30,\r\n left : 0,\r\n color : \"red\"\r\n }\r\n },{\r\n type : 'Ti.UI.Button',\r\n bindId : 'btn3',\r\n properties : {\r\n width : 50,\r\n height : 30,\r\n left : 0,\r\n color : \"blue\"\r\n }\r\n }]\r\n};\r\n\r\nvar listview = Ti.UI.createListView({\r\n width : Ti.UI.FILL,\r\n height : Ti.UI.FILL,\r\n templates : {\r\n 'default' : mytemplate\r\n },\r\n defaultItemTemplate : 'default'\r\n});\r\n\r\nlistview.sections = [Ti.UI.createListSection()];\r\n\r\nvar newData = [];\r\nfor(var i = 0 ; i < 10 ; i++){\r\n\t\r\n\tnewData.push({\r\n\t\tbtn1 : { title : \"a \" + 1 },\r\n\t\tbtn2 : { title : \"b \" + 1 },\r\n\t\tbtn3 : { title : \"c \" + 1 }\r\n\t});\r\n\t\r\n}\r\n\r\nlistview.sections[0].setItems(newData);\r\n\r\nwin.add(listview);\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\n*Actual result* : first screen shot\r\n\r\n*Expected result* : second screen shot\r\n", "attachment": [ { "id": "63435", "filename": "Simulator Screen Shot - iPhone 5s - 2017-10-13 at 17.16.38.png", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2017-10-13T15:20:22.000+0000", "size": 33589, "mimeType": "image/png" }, { "id": "63434", "filename": "Simulator Screen Shot - iPhone 5s - 2017-10-13 at 17.17.03.png", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2017-10-13T15:20:22.000+0000", "size": 47047, "mimeType": "image/png" } ], "flagged": false, "summary": "Listview horizontal layout doesn't work", "creator": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "environment": "Appcelerator Studio build: 4.10.0.201709271713\r\nTitanium SDK 6.2.2.GA\r\nApple SDK iOS 11\r\nCLI version 5.0.4\r\nXcode 9", "closedSprints": [ { "id": 959, "state": "closed", "name": "2017 Sprint 21 SDK", "startDate": "2017-10-08T20:38:15.130Z", "endDate": "2017-10-22T20:38:00.000Z", "completeDate": "2017-10-24T23:55:56.605Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "429091", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I was able to reproduce the issue for listview item. The layout property for templates is not working. Tested with Xcode 9 and SDK 6.2.2.GA. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-10-13T20:26:45.000+0000", "updated": "2017-10-13T20:26:45.000+0000" }, { "id": "429095", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there! Is this only occurring with Xcode 9 and 6.2.2? I am seeing the same when using older SDK's (e.g. 6.1.x). Also, you apply the {{layout}} property to the list-item directly, which is not a supported (and not documented) property. You should always use a sub-view that has the horizontal layout and relate the other views to that one. Example:\r\n\r\n{code:js}\r\nvar win = Ti.UI.createWindow();\r\n \r\nvar mytemplate = {\r\n childTemplates : [{\r\n type : 'Ti.UI.View',\r\n properties : {\r\n layout: 'horizontal'\r\n },\r\n childTemplates : [{\r\n type : 'Ti.UI.Button',\r\n bindId : 'btn1',\r\n properties : {\r\n width : 50,\r\n left : 0,\r\n color : \"green\"\r\n }\r\n },{\r\n type : 'Ti.UI.Button',\r\n bindId : 'btn2',\r\n properties : {\r\n width : 50,\r\n left : 0,\r\n color : \"red\"\r\n }\r\n },{\r\n type : 'Ti.UI.Button',\r\n bindId : 'btn3',\r\n properties : {\r\n width : 50,\r\n left : 0,\r\n color : \"blue\"\r\n }\r\n }]\r\n }]\r\n};\r\n \r\nvar listview = Ti.UI.createListView({\r\n width : Ti.UI.FILL,\r\n height : Ti.UI.FILL,\r\n templates : {\r\n 'default' : mytemplate\r\n },\r\n defaultItemTemplate : 'default'\r\n});\r\n \r\nlistview.sections = [Ti.UI.createListSection()];\r\n \r\nvar newData = [];\r\nfor(var i = 0 ; i < 10 ; i++){\r\n\t\r\n\tnewData.push({\r\n\t\tbtn1 : { title : \"a \" + 1 },\r\n\t\tbtn2 : { title : \"b \" + 1 },\r\n\t\tbtn3 : { title : \"c \" + 1 }\r\n\t});\r\n\t\r\n}\r\n \r\nlistview.sections[0].setItems(newData);\r\n \r\nwin.add(listview);\r\n \r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-13T21:35:51.000+0000", "updated": "2017-10-13T21:40:22.000+0000" }, { "id": "429117", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2017-10-16T06:48:58.000+0000", "updated": "2017-10-16T06:50:59.000+0000" }, { "id": "429122", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Re TIMOB-24277, this is an Android-only behavior and should not even work in general (parity). Re the docs, the link references the Ti.UI.ListView docs, but the API used is the Ti.UI.ListItem (an item inside a section inside a list).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-16T07:52:15.000+0000", "updated": "2017-10-16T07:52:15.000+0000" }, { "id": "429123", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "body": "Ok. So this is not a bug. I will use a parent view as usual. Thank you", "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2017-10-16T07:56:22.000+0000", "updated": "2017-10-16T07:56:44.000+0000" }, { "id": "429124", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thank you! Let us know if you see any other issues :-).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-16T07:57:51.000+0000", "updated": "2017-10-16T07:57:51.000+0000" }, { "id": "440296", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as \"not our bug\". If you disagree, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:52:09.000+0000", "updated": "2018-08-06T17:52:09.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }