Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked October 31st 2010 by Josh Lewis
  • array
  • iphone
  • views
0 Comments

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

    — answered October 31st 2010 by Stephane Pelamourgues
    permalink
    0 Comments
  • 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

    — answered November 1st 2010 by Patrick van Zadel
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.