Array of views?
I'm looking at building an app for a band, and am getting pretty comfortable with Titanium and how it all works. So is this possible?
I have tabs, and on one will be me music. They click that , and I'm wanting 5 views I can swipe left or right on, and each will have a little info, a play now button, and a link in iTunes. Is there a way to create am array of views that can do this?
2 Answers
-
you can create a Titanium.UI.createScrollableView and then attach your view (with addView) to it,
so when the user swipe it will see your differents view
-
It really depends a little on the exact functionality you want I can give you 2 sample codes that dynamically adds/push views based on a list of content.
it isn't exactly what youre looking for but the setup should be of the same way.
http://pastie.org/1258054
First I create the scrollView where my data is going in.
Then I define the new array "viewArr"
after that I take the array "thumbs" and gives each image from the array his own imageView.
These imageViews in turn get a 'click' function (open_page).after this is done, I add the viewArr to the scrollView.
And then Push all the images into that viewArr.add the scrollView and voila we have a working concept.
otherwise:
http://pastie.org/1263562
this code creates an gallery like interface like the ipads gallery, you slide the views left and right each containing theire own image