How to add searchbar in tableview
Hello,
I want to add searchbar in basic table view, how it is possible?
1 Answer
-
var win = Titanium.UI.currentWindow; // SEARCH BAR var search = Titanium.UI.createSearchBar({ barColor:'#000', showCancel:false }); // CREATE TABLE VIEW var tableView = Titanium.UI.createTableView({ data:data, search:search, searchHidden:true }); win.add(tableView);
Somethin' like that. That would create a black search bar that you would have to scroll up to view.
Basically all you need is to have a "createSearchBar" somewhere in the file, then have "search:<SearchBar" in the createTableView and you're golden ;)
For more properties of the Search Bar, check the API Reference.