Problem description
The searchbar for the tableview is not rendered when the display area for the searchbar is out of the display range.
Steps to reproduce
1. Tap the nav button "search" to show the searchbar of the tableview
2. Tap the nav button again to hide the searchbar
3. Scroll down to the last entry of the tableview
4. Tap the nav button "search"
Result: The searchbar is not rendered. There is only a white area on the top of the tableview.
Hint: Tap on the white area and the search will appear
Test case
(function() {
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow();
var navWin = Titanium.UI.iOS.createNavigationWindow({window: win});
var rightNavBtn = Ti.UI.createButton({title: L('search')});
var tableData = [];
var tableView;
var searchBar = Titanium.UI.createSearchBar();
for (var i=0; i < 50; i++) {
tableData.push({title: 'Entry ' + i});
}
tableView = Ti.UI.createTableView({data: tableData});
rightNavBtn.addEventListener('click', function(){
if(tableView.getSearch()){
tableView.setSearch(null);
}else{
tableView.setSearch(searchBar);
tableView.scrollToTop(0);
}
});
win.rightNavButton = rightNavBtn;
win.add(tableView);
navWin.open();
})();
No comments