Description
A 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.
Code to reproduce
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'Table w/ Search',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Table w/ Search',
window:win1
});
var allNoteTypes = [
{title:'Plan 1'},
{title:'Plan 2'},
{title:'Plan 3'}
];
var searchBar = Ti.UI.createSearchBar({barColor: "#283D5A",
hintText: "SR Number"
});
var table = Ti.UI.createTableView({
top: 0,
width:"100%",
backgroundColor:'transparent',
hideSearchOnSelection: false,
data:allNoteTypes,
search: searchBar
});
win1.add(table);
function handleSearchBarFocus(_event) {
win1.hideNavBar();
searchBar.setShowCancel(true);
}
function handleSearchBarBlur(_event) {
win1.showNavBar();
searchBar.setShowCancel(false);
}
searchBar.addEventListener("focus", handleSearchBarFocus);
searchBar.addEventListener("blur", handleSearchBarBlur);
tabGroup.addTab(tab1);
tabGroup.open();
Note
Same code works fine on iOS6 using stable XCode
[~dcassenti] Screenshots?
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. Use the code below to adjust for IOS7
Closing ticket as invalid.