Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Keep Searchbar at the top of the Tableview when Scrolling

$
0
0

I have studied the following 2 questions, both asking exactly what I am asking:

https://developer.appcelerator.com/question/117432/keep-searchbar-at-the-top-of-the-tableview-when-scrolling https://developer.appcelerator.com/question/10611/adding-table-view-beneath-searchbar

The problem is, there is no confirmed and correct answer given on either question. Solutions are suggested and follow-up comments always say "that didn't work". The one exception, where a comment says "that works perfectly", seems to be referring to an answer that doesn't use a search bar at all, and seems pointless.

So I'm just looking for a good approach to keeping the search bar visible even when scrolling down through the table rows. I have hundreds of rows in my table. The table loads fast, the rows scroll fine, and the search works perfectly. The only problem (same as in the other 2 posts) is that the moment you start scrolling down in the table, the search bar scrolls up out of site. I'm amazed that the default behavior is for the searchbar to disappear as soon as you scroll. It's hard to imagine anyone wanting that behavior ever.

Here is my code:

var searchbar = Ti.UI.createSearchBar({
    showCancel: true,
    top: 5
});
 
var movies = Ti.UI.createTableView({
    data: movieData,
    top: 30,
    height: '75%',
    search: searchbar,
    hideSearchOnSelection: false
});
Thanks!

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>