Appcelerator. Switch between layouts with includes.
I am developing an iOS app in Appcelerator that the user can choose between different layout types when viewing their contacts.
I am trying to use the code below and it works one time but after switching between the modes the layouts does not disappear.
How can I alter my code to switch between layouts?
http://pastie.org/2288951
Th开发者_开发技巧ankful for all input!
Maybe you just add view each time and forget to open()\hide() it, or window (I can't say exact because I don't know what is in contacts.js and contacts_avatar.js.) or if it is tableView try and data changes, try to tableView.setData(data) each time you switch.
the best approach is to include both modules and map the functions appropriately in the code based on the selection from the user.
basic concept is to have two different objects that implement the same layout interface/methods and functions
精彩评论