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 TableViewRow

Hi Guys,

I have really been struggling with Android using TableViewRow's Height property. I have three labels to be placed in a row vertically. BUt only two of the labels appear and the third label is hidden because although i set height of the tableViewRow to 'auto' it still sticks to a constant height. Has anyone got a work around to this? even using a single label with n crops the label in the row.

This seems to be a real big bug in appcelerator and unless such is fixed it would be impossible to develop commercial apps using this framework.

var matchNameLabel = Ti.UI.createLabel({
                text: matchName+'n'+date+'n'+venue+'n'+result,
                font: {fontSize: 14},
                textAlign: 'center',
                left: 0,
                top: 0,                
                bottom: 0,
                right:0,
                height: 'auto',
                className:'matchNameLabel',
                width:'auto'

            });
var matchRow = Ti.UI.createTableViewRow({
                className: 'match'+i,
                layout:'vertical',
                                height:'auto',
                                width:'auto',
                backgroundColor: '#000000'
            });
            matchRow.add(matchNameLabel);
var tableView = Titanium.UI.createTableView({
            data: data,
            height: 'auto',
            width: 'auto',
            className: 'myTable'
        });
— asked April 20th 2010 by sanchit sharma
  • android
  • height
  • row
0 Comments

8 Answers

  • I am facing the same problem. Have you found a solution?

    — answered August 5th 2010 by Abraham Vivas
    permalink
    0 Comments
  • Does anyone know if this was resolved? I'm having the same issue.

    Thanks

    — answered October 25th 2010 by Dave F
    permalink
    0 Comments
  • Still experiencing this. if I test the height of a row when set height: "auto" I get a value of 0. All rows are the same height and don't expand based on the content with in them. Works fine on iphone. Anyone know if there's a workaround?

    — answered November 20th 2010 by Dave F
    permalink
    0 Comments
  • I'm also having the same issue. Specifying a numerical height for the row shows all data, but that's no use for dynamic data.

    — answered November 23rd 2010 by Julian Fraser
    permalink
    0 Comments
  • Vertical layout on TableViewRow in Android is not working. I'm using mobile API 1.5.1 and found that while such a vertical layout works on the iPhone it does not work on Android.

    However, if you add your labels etc to a view with vertical layout, and then add the view to the row it works.

    Here is a ticket I found on this issue: https://appcelerator.lighthouseapp.com/projects/32238/tickets/1405-vertical-layout-fails-inside-a-tableviewrow-on-android

    — answered December 23rd 2010 by Paul Townsend
    permalink
    0 Comments
  • Vertical layout on TableViewRow in Android is not working. I'm using mobile API 1.5.1 and found that while such a vertical layout works on the iPhone it does not work on Android.

    However, if you add your labels etc to a view with vertical layout, and then add the view to the row it works.

    Here is a ticket I found on this issue: https://appcelerator.lighthouseapp.com/projects/32238/tickets/1405-vertical-layout-fails-inside-a-tableviewrow-on-android

    — answered December 23rd 2010 by Paul Townsend
    permalink
    0 Comments
  • I used a view within the TableViewRow like this:

    var row = Titanium.UI.createTableViewRow(params);
    
    var mainView = Ti.UI.createView({layout:'vertical', height: 'auto', left: 0, right: 0, backgroundColor: 'transparent', backgroundSelectedColor: 'transparent', backgroundFocusedColor: 'transparent'});
    row.add(mainView);
    

    But it had the disadvantage that the row is not highlighted if someone selects/clicks the row. So, I just don't use it. Even if one sets focusable to true and so on.

    Cheers

    — answered March 7th 2011 by Jicks Steen
    permalink
    0 Comments
  • Has this been fixed? Im still having problem android row height using dynamic data inside a view.

    — answered September 25th 2011 by Aizil Akmar Omar
    permalink
    1 Comment
    • workaround: don't put your longest label/text in a view. Put it directly on the row.add() and it will auto height based on the text.

      — commented September 25th 2011 by Aizil Akmar Omar
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.