Reusable Views
Is it possible to use the same view multiple times? Kind of like you would in HTML and CSS?
For example I have a scroll view with many views in it and in each of those views I would like the reuse a view so I don't have to write it over and over.
Thanks
1 Answer
-
Accepted Answer
To avoid writing a lot of code you could make something more abstract for the view.
function view_to_use() { var view = Titanium.UI.createView({ .... }); return view; }
then in your code to do something like
the_element_to keep_the_view.add( view_to_use() );
You can go lot further than this.