Titanium Community Questions & Answer Archive

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

ScrollableView insert view

Hi.

I know i can add a view to a ScrollableView but it is possible to insert a view?

In API i don't see any "insert" method so, i assume it can be done by maintaining an array with the views but i can't find a method to "update" the views in the ScrollableView.

Any tips?

Thank you

— asked May 9th 2010 by Catalin C.
  • mobile
  • scrollableview
0 Comments

3 Answers

  • This will add a view at the end.
    I know this :)

    What i want to do:

    • i have 5 views for ex: v1, v2, v3, v4, v5 and i want to insert another view v31 between v3 and v4.
    — answered May 10th 2010 by Catalin C.
    permalink
    0 Comments
  • By any chance, have you found any resolution for this?

    Thanks in advance

    — answered April 17th 2012 by Roozbeh Zabihollahi
    permalink
    0 Comments
  • Try addView method, i think kitchensink has an example of it. "scroll_views_scrollable.js"

    var newView = Ti.UI.createView({
            backgroundColor:'purple'
        });
        var l = Ti.UI.createLabel({
            text:'View ' + (scrollView.views.length+1),
            color:'#fff',
            width:'auto',
            height:'auto'
        });
        newView.add(l);
        scrollView.addView(newView);
    
    — answered May 9th 2010 by Daniel Lim
    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.