{ "id": "119585", "key": "TIMOB-15066", "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": "2013-09-06T17:32:10.000+0000", "created": "2013-09-06T14:07:04.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios7", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T21:44:05.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": "h2. Description\r\nA window has a navigation bar and a table with search; when focusing on the search bar, the navigation bar is hidden programmatically. This leads to the search bar to be moved up, overriding the iOS status bar.\r\n\r\nh2. Code to reproduce\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Table w/ Search',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Table w/ Search',\r\n window:win1\r\n});\r\n\r\nvar allNoteTypes = [\r\n\t{title:'Plan 1'},\r\n\t{title:'Plan 2'},\r\n\t{title:'Plan 3'}\r\n];\r\n\r\nvar searchBar = Ti.UI.createSearchBar({barColor: \"#283D5A\",\r\n\thintText: \"SR Number\"\r\n});\r\n\r\nvar table = Ti.UI.createTableView({\r\n\ttop: 0,\r\n\twidth:\"100%\",\r\n\tbackgroundColor:'transparent',\r\n\thideSearchOnSelection: false,\r\n\tdata:allNoteTypes,\r\n\tsearch: searchBar\r\n});\r\n\r\nwin1.add(table);\r\n\r\nfunction handleSearchBarFocus(_event) {\r\n\twin1.hideNavBar();\r\n\tsearchBar.setShowCancel(true);\r\n}\r\n\r\nfunction handleSearchBarBlur(_event) {\r\n\twin1.showNavBar();\r\n\tsearchBar.setShowCancel(false);\r\n}\r\n\r\nsearchBar.addEventListener(\"focus\", handleSearchBarFocus);\r\nsearchBar.addEventListener(\"blur\", handleSearchBarBlur);\r\n\r\ntabGroup.addTab(tab1); \r\n\r\ntabGroup.open();\r\n{code}\r\n\r\nh2. Note\r\nSame code works fine on iOS6 using stable XCode", "attachment": [ { "id": "42217", "filename": "iOS Simulator Screen shot 6 Sep 2013 17.39.25.png", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-09-06T16:40:21.000+0000", "size": 114771, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS7: TableView SearchBar overrides the status bar when hiding the window navigation bar", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "SDK 3.1.3.v20130904134612\r\nXCode 5 DP6\r\niOS7 beta 6", "comment": { "comments": [ { "id": "269917", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~dcassenti] Screenshots?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-06T15:35:46.000+0000", "updated": "2013-09-06T15:35:46.000+0000" }, { "id": "269973", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "On IOS7 the root view controller is full screen (which means it will extend underneath the status bar). On IOS6 it is not. When you hide the navBar, the tableView will occupy the full screen on IOS7 and hence the searchbar will be below the status bar. You will have to adjust the UI for IOS7. Set the top for tableView to 20 (STATUS BAR HEIGHT) and things should be ok.\r\n\r\nUse the code below to adjust for IOS7\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nfunction isiOS7Plus()\r\n{\r\n // add iphone specific tests\r\n if (Titanium.Platform.name == 'iPhone OS')\r\n {\r\n var version = Titanium.Platform.version.split(\".\");\r\n var major = parseInt(version[0],10);\r\n \r\n // can only test this support on a 3.2+ device\r\n if (major >= 7)\r\n {\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n}\r\n\r\nvar isIOS7 = isiOS7Plus();\r\n\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n \r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Table w/ Search',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Table w/ Search',\r\n window:win1\r\n});\r\n \r\nvar allNoteTypes = [\r\n {title:'Plan 1'},\r\n {title:'Plan 2'},\r\n {title:'Plan 3'}\r\n];\r\n \r\nvar searchBar = Ti.UI.createSearchBar({barColor: \"#283D5A\",\r\n hintText: \"SR Number\"\r\n});\r\n \r\nvar table = Ti.UI.createTableView({\r\n top: 0,\r\n width:\"100%\",\r\n backgroundColor:'transparent',\r\n hideSearchOnSelection: false,\r\n data:allNoteTypes,\r\n search: searchBar\r\n});\r\n \r\nwin1.add(table);\r\n \r\nfunction handleSearchBarFocus(_event) {\r\n win1.hideNavBar();\r\n if (isIOS7) {\r\n table.top = 20;\r\n };\r\n searchBar.setShowCancel(true);\r\n}\r\n \r\nfunction handleSearchBarBlur(_event) {\r\n win1.showNavBar();\r\n table.top = 0;\r\n searchBar.setShowCancel(false);\r\n}\r\n \r\nsearchBar.addEventListener(\"focus\", handleSearchBarFocus);\r\nsearchBar.addEventListener(\"blur\", handleSearchBarBlur);\r\n \r\ntabGroup.addTab(tab1); \r\n \r\ntabGroup.open();\r\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-09-06T17:32:10.000+0000", "updated": "2013-09-06T17:32:10.000+0000" }, { "id": "415030", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T21:44:05.000+0000", "updated": "2017-03-22T21:44:05.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }