Titanium Community Questions & Answer Archive

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

Android issues with layout and views

I'm just wondering if android responds to layout in any way. For example, I cannot seem to get the following to work.

var body = Ti.UI.createView({height:'auto', layout:'vertical'});

var bodyView1 = Ti.UI.createView({backgroundColor:'#336699', height:100, left:10, right:10});
var bodyView2 = Ti.UI.createView({backgroundColor:'#ff0000', height:50, left:10, right:10, top:10});
var bodyView3 = Ti.UI.createView({backgroundColor:'orange', height:50, left:10, right:10, top:10});
body.add(bodyView1);
body.add(bodyView2);
body.add(bodyView3);

win.add(body)

Also, I have been having troubles with table views and setting the height of a row. Is it possible to have a table view with many rows of varying heights?

— asked April 14th 2010 by nobody anonymous
  • android
  • layout
  • tableview
  • verticle
0 Comments

3 Answers

  • I get the sense that there isn't a great amount of interest in using Titanium to develop Android Apps, with the focus being more on iPhone Apps.

    I've noticed quite a few titanium features don't work correctly or don't work at all in Android which is a shame. Any idea on when the Android Api's will catch up?

    — answered April 15th 2010 by nobody anonymous
    permalink
    0 Comments
  • We are continually working on improving the Android API coverage. Vertical layout was added very late in the cycle for 1.0 and we've had other issues with higher priority. It will get implemented.

    — answered April 15th 2010 by Don Thorp
    permalink
    0 Comments
  • "nobody anonymous",

    I'm deleting my previous post here, which was incorrect.

    However, just to note that the layout property is indeed available for both window and view, although it does not appear in the view's api docs:

    Titanium.UI.View-object

    I have raised a ticket to correct this here:
    vertical-layouts-for-views

    — answered June 23rd 2010 by Paul Dowsett
    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.