If you set "searchHidden" to true, you can scroll perfectly the TableView.
But if you set it to false, you are unable to scroll until you click the SearchBar.
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
win1.addEventListener('focus', function(){
tableview.searchHidden = false;
Ti.API.info("tableView = false");
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var searchBar = Ti.UI.createSearchBar({
cancel:false
});
var tableview = Ti.UI.createTableView({
search: searchBar,
scrollable:true,
data:[ { title:'dog'}, { title:"cat"}, { title:"bird"},
{ title:'frog'}, { title:"turtle"}, { title:"lizard"},
{ title:'hamster'}, { title:"snake"},
{ title:'shark'}, { title:"elephant"}, { title:"mouse"},
{ title:'lion'}, { title:"gorilla"}, { title:"eagle"},
{ title:'fish'}, { title:"squirrel"} ]
});
tableview.addEventListener("click", function(e) {
alert("Index " + e.index + " \n" + e.rowData.title);
});
var scrollView = Titanium.UI.createScrollView({
top:0,
contentHeight:0,
showVerticalScrollIndicator:true
});
scrollView.add(tableview);
win1.add(scrollView);
var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
win2.addEventListener('focus', function(){
tableview.searchHidden = true;
Ti.API.info("tableView = true");
});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win2.add(label2);
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();
Resolving issue as the pull has been accepted.
Passed as expected on: iPod 3rd Gen 4.0.2 iPad 2 4.3.2 iPhone 4 4.2.10 SDK: version=1.8.0 timestamp=08/26/11 14:53 githash=8e978eb...