TableView with SearchBar will not scroll
I created a standard tableview snd added a search bar object to it using the code below. When the view appears the tableview cannot/will not scroll. If I click in the search field and immediately click cancel, the tableview starts to function (scroll) normally. I am adding the search bar like this:
var search = Titanium.UI.createSearchBar({
showCancel:false,
height:43,
top:0
});
search.addEventListener('return',function(e){
var swin = Titanium.UI.createWindow({
url:'search_view.js',
title:e.value,
backgroundColor:'#FFF'
});
Titanium.UI.currentTab.open(swin,{animated:true});
});
var tableview = Titanium.UI.createTableView({
search:search,
searchHidden:false
});
Any help?
7 Answers
-
Stumbled across a solution. Set the 'search' property of the tableView after the tableView has been added to the window. Scrolls without first having to interact with the search bar.
var win = Titanium.UI.createWindow(); var search = Titanium.UI.createSearchBar({ barColor:'#385292', showCancel:false, hintText:'search' }); var yourTableView = Titanium.UI.createTableView({ data:data, searchHidden:false }); win.add(yourTableView); yourTableView.search = search;
Hope that helps you out…
-
I have the same issue here, did you find any fix for it?
-
Same problem here.. no solution?
-
try this:
var tableview = Titanium.UI.createTableView({ search:search, searchHidden:false, scrollable: true });
-
It seems to be a problem with the Titanium SDK that has not been fixed since before 1.5.0. I'm still waiting for a fix for this. I seemed to "hack" this by quickly focusing then blurring the search bar (Or simply just focusing it and leaving it), which causes the TableView to become scrollable again.
-
Simply commenting out searchHidden:false worked for me. - If you can be without it.
-
Standard info, first:
Titanium Studio, build: 1.0.2.201107130739
Use: iOS and Android DevelopmentThe issue I am having with the iPhone and the search bar is that when I scroll down, I cannot seem to keep the search bar in a fixed position without sacrificing the user's ability to scroll.
The goal is to keep the search bar up top and fixed. Would I be correct to say I need to create a View spot for it (all on it's own) within the Window I have?
Thnx!
-Jesse