{ "id": "144918", "key": "TIMOB-18891", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-05-02T22:08:51.000+0000", "created": "2015-02-18T19:41:14.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "listview", "setHeaderView" ], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-02T22:08:51.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": "*Description*\r\nThe listView reports an error that the setHeaderView method not exist for listView object when trying to run it on android simulator and crashes.\r\n\r\nSetting the direct value for listView.headerView won't complain but neither does it show the headerView for the listView.\r\n\r\nThere is actually a [Q&A|http://developer.appcelerator.com/question/161410/listview-does-not-have-method-setheaderview-on-android#answer-285954] related to this issue about 1 year ago, but it seems unnoticed and not resolved yet.\r\n\r\n*What's expected*\r\nAs from the [latest document | http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.ListView-method-setHeaderView], setHeaderView should be available since Android 3.2. So the inconsistency make me a little confused.\r\n\r\n*Step to reproduce*\r\nThe following code is quoted from the sample given in listview documentation. I am trying to add a search bar as it suggested in the kitchensink sample. \r\n{quote}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\nvar listView = Ti.UI.createListView();\r\nvar sections = [];\r\n\r\nvar vegSection = Ti.UI.createListSection({ \r\nheaderTitle: 'Vegetables'\r\n});\r\nvar vegDataSet = [\r\n {properties: { title: 'Carrots'}},\r\n {properties: { title: 'Potatoes'}},\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n\r\nlistView.sections = sections;\r\n\r\nvar searchTextField = Ti.UI.createTextField({\r\n borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,\r\n color: '#333',\r\n height: Ti.UI.FILL,\r\n left:5,\r\n \tright:5,\r\n top: 5,\r\n bottom: 5,\r\n hintText: 'Search',\r\n clearButtonMode: Titanium.UI.INPUT_BUTTONMODE_ONFOCUS\r\n});\r\nvar searchBar = Ti.UI.createView({\r\n\tbackgroundColor: \"#ccc\",\r\n\twidth: Ti.UI.FILL,\r\n\theight: \"35dp\"\r\n});\r\nsearchBar.add(searchTextField);\r\nlistView.setHeaderView(searchBar);\r\nwin.add(listView);\r\nwin.open();\r\n{quote}\r\n", "attachment": [], "flagged": false, "summary": "Android: setHeaderView method not exist", "creator": { "name": "yeelan0319", "key": "yeelan0319", "displayName": "Yiran Mao", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "yeelan0319", "key": "yeelan0319", "displayName": "Yiran Mao", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MAC OSX 10.9.5\r\nTitanium Studio, build: 3.4.0.201409261227\r\nTitanium SDK 3.4.0.GA\r\nAndroid Simulator 4.4.2(API level 19)", "comment": { "comments": [ { "id": "351466", "author": { "name": "happytuna", "key": "happytuna", "displayName": "Simone Semprini", "active": true, "timeZone": "Europe/Rome" }, "body": "are there any news on this issue? I found the same problem and the only workaround I found is using the first section header as the list header, which is of course not optimal and works in my case just because I have always only one section in my list.", "updateAuthor": { "name": "happytuna", "key": "happytuna", "displayName": "Simone Semprini", "active": true, "timeZone": "Europe/Rome" }, "created": "2015-05-02T12:54:26.000+0000", "updated": "2015-05-02T12:54:26.000+0000" }, { "id": "418946", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-02T22:08:51.000+0000", "updated": "2017-05-02T22:08:51.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }