This has to be one of the most common tasks for a business app and yet there is no Corona Labs sample showing how to implement one properly…
I have been looking around to see if any such thing exist but I could not find a recent (ie Widget 2.0) and simple sample so I decided to build one…Here’s a quick and dirty start. I used IOS Mail app search bar behavior as my model and even grabbed some of the graphics from there. Hope thats ok with Apple copyright etc.
Attached is a modified main.lua for the ListView2 sample and some additional png files to go with it. I focused on the search bar creation, aesthetics and transitions etc. I did not implement the actual dataset reduction by search text entered as this will be different from app to app (ie SQLite vs other data set used etc). I think anyone making use of the search can/should put in their own dataset reduction routine…
The purpose of this sample is to do the Search bar creation, text entry, text entered being reset (little X in the Search bar) and ultimately the Search Cancel option. My idea is to put only what is pertaining to the search mechanics into this sample so anyone can take it and plug it into their own tableView based app with minimal tweaking…
It is a little crude at this point but I think its a good start. Please feel free to use as is or improve and post back on this thread so we can all make use of your improvements.
Thank you very much in advance for any updates / improvements and corrections!!! Enjoy!
Edit : Attached main.txt is a copy of the main.lua. Simply rename back to .lua before use. Hope this makes the thread easier to use.