Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3046] TableViewRow not rendering corectly on android

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-08-29T15:27:21.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, rendering, tableview, tableviewrow
Reporterdoto
AssigneeNeeraj Gupta
Created2011-04-15T03:35:24.000+0000
Updated2017-03-10T18:18:02.000+0000

Description

When you have a TableViewRow with a sub view it has a padding on the left and right:

http://img.skitch.com/20110204-eyjc8iaj7ebkc11b9rk6drbn5.png" alt= "alt text">

Also when zou scroll this row off the view it disapears when it comes back.

http://img.skitch.com/20110204-funb32q1q5usjcqddesjdtum32.png" alt="alt text">

Code:

var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});


var data = [];
for(var i=0; i<20; i++){
    var tvr = Titanium.UI.createTableViewRow({
        className : 'datarow'
    });
    var view = Titanium.UI.createView({
        backgroundColor: "#cfc"
    });
    var label = Titanium.UI.createLabel({
        text: "Line "+ i,
        height: 100
    });
    view.add(label);
    tvr.add(view);
    data.push(tvr);
}

var tv = Titanium.UI.createTableView({
    data:data
});

win1.add(tv);
tabGroup.addTab(tab1);  
tabGroup.open();

Comments

  1. Stephen Tramer 2011-04-15

    Assigning to Don for triage.

  2. Don Thorp 2011-04-15

    @doto which version of the product did you test with?

  3. doto 2011-04-15

    I've testet it with Titanium SDK version: 1.5.1 (12/16/10 16:25 16bbb92))

  4. doto 2011-04-15

    I've done a little more testing. The rows are not disappearing now, but the order seems to change every time I scroll up an down. Strange.

    Here's the code:

        
       var data = [];
       for(var i=0; i<20; i++){

       var tt = &quot;Line &quot;+i;
       var len = 80 + Math.round(Math.random()*200);
       var label= &quot;&quot;;
       while(label.length &lt; len) label += &quot; &quot; + tt;
       
       Titanium.API.info(label);
       var tvr = Titanium.UI.createTableViewRow({
           className : 'datarow'
       });
       var view = Titanium.UI.createView({
           backgroundColor: &quot;#cfc&quot;,
           height: &quot;auto&quot;
       });
       var label = Titanium.UI.createLabel({
           text: label
       });
       view.add(label);
       tvr.add(view);
       data.push(tvr);
       
       
       
       
    }
    var tv = Titanium.UI.createTableView({
       data:data
       
       
       
       
    });

    https://img.skitch.com/20110218-rt3u9ge93hxr9diw811qy1w7u3.png" alt="emulator screenshot">

    .. and the log output:

    [INFO] [631,741] Line 0 [INFO] [515,1256] Line 1 [INFO] [122,1378] Line 2 [INFO] [69,1447] Line 3 [INFO] [61,1508] Line 4 [INFO] [21,1529] Line 5 [INFO] [24,1553] Line 6 [INFO] [29,1582] Line 7 [INFO] [15,1597] Line 8 [INFO] [26,1623] Line 9 [INFO] [26,1649] Line 10 [INFO] [28,1677] Line 11 [INFO] [21,1698] Line 12 [INFO] [21,1719] Line 13 [INFO] [21,1740] Line 14 [INFO] [23,1763] Line 15 [INFO] [23,1786] Line 16 [INFO] [17,1803] Line 17 [INFO] [31,1834] Line 18 [INFO] [28,1862] Line 19

  5. Junaid Younus 2012-08-29

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120828153312, unable to reproduce the issue. Ticket marked as resolved.
  6. Lee Morris 2017-03-10

    Closing ticket as the issue cannot be reproduced.

JSON Source