Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8689] Android: Setting height to Ti.UI.SIZE on a TableViewRow causes the row to not display

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-13T00:36:47.000+0000
Affected Version/sRelease 2.0.0, Release 3.0.0
Fix Version/sRelease 2.1.0, Sprint 2012-12 API, Release 2.1.3, Release 3.0.0, Release 3.1.0, 2012 Sprint 21 Core, 2012 Sprint 21
ComponentsAndroid
Labelsandroid, core, module_tableviewrow, qe-and090112, qe-and100112, qe-review, qe-testadded, regression
ReporterOpie Cyrus
AssigneeAllen Yeung
Created2012-04-11T15:25:05.000+0000
Updated2012-12-21T19:41:33.000+0000

Description

Setting height to Ti.UI.SIZE on a tableview row causes the row to not display.
var win  = Ti.UI.createWindow({
	backgroundColor:'#000',
});

var table = Ti.UI.createTableView({
		backgroundColor:'transparent',
		separatorColor:'transparent',
});

var varHeightRow = Ti.UI.createTableViewRow({
	backgroundColor:'#FFF',
	height:Ti.UI.SIZE,
	layout:'vertical',
	selectionStyle:Titanium.UI.iPhone.TableViewCellSelectionStyle.NONE
});

var rowContent = Ti.UI.createView({
	height:20,
	left:5,
	right:5,
	top:10,
	bottom:10,
	borderColor:'#C00',
	borderWidth:1,
});

var contentContent = Ti.UI.createLabel({
	backgroundColor: 'white',
	text:'This is a test'
});

rowContent.add(contentContent);

varHeightRow.add(rowContent);

table.appendRow(varHeightRow);
win.add(table);

win.open();

Comments

  1. Devang Gandhi 2012-04-30

    Also observed with a customer. His code sample.
    var win = Ti.UI.createWindow({
               fullscreen : false,
               backgroundColor : 'white'
       });
        
       var tableView = Ti.UI.createTableView({
               top : 0,
               bottom : 0,
               right : 0,
               left : 0
       });
        
       var rows = [];
        
       var tableViewRow1 = Ti.UI.createTableViewRow({
               height : 'auto'
       });
        
       var tableViewRow2 = Ti.UI.createTableViewRow({
               height : Ti.UI.SIZE
       });
        
        
       var label = Ti.UI.createLabel({
               text : 'BLAH BLAH!',
               top : '0dp',
               left : '108dp',
               height : Ti.UI.SIZE
       });
        
       tableViewRow1.add(label);
       tableViewRow2.add(label);
        
       rows.push(tableViewRow1);
       rows.push(tableViewRow2);
        
       tableView.data = rows;
        
       win.add(tableView);
        
       win.open();
  2. Ping Wang 2012-06-04

    PR https://github.com/appcelerator/titanium_mobile/pull/2320
  3. Natalie Huynh 2012-06-14

    Tested with Droid 3 2.3.4 and Emulator 2.2 with 2.1.0.v20120614102250
  4. Tamila Smolich 2012-09-19

    Reopening issue. Tested on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK, build: 2.1.3.v20120918170114 Device: Nexus 7 (4.1.1) This is regression. Does not occur on 2.1.2.
  5. Wilson Luu 2012-09-19

    I have a similar issue, but the *Ti.UI.SIZE* is set in view.height then placed in a TableViewRow (see below). *Tested on:* Titanium Studio, build: 2.1.2.201208301612 SDK build: 2.1.3.v20120918170114 Device: Droid 1 (2.2.3), Galaxy Nexus (4.0.4), Nexus S (4.1.1) *Bug does not occur in 2.1.2.GA* *The code:* \\
       var win = Ti.UI.createWindow({
           backgroundColor: '#000',
           navBarHidden: true
       });
       
       var tableView = Ti.UI.createTableView({});
       win.add(tableView);
       
       var row = Ti.UI.createTableViewRow({});
       
       var container = Ti.UI.createView({
       	height: Ti.UI.SIZE, // bug is here
       	backgroundColor: '#fff',
       	borderColor: '#ccc', borderWeight: 1
       });
       
       container.add(Ti.UI.createLabel({
           text: "I am a monkey",
       }));
       
       row.add(container);
       
       tableView.appendRow(row);
       
       win.open();
       
  6. Ping Wang 2012-09-19

    The regression is caused by the border. Should be fixed by [PR#2980](https://github.com/appcelerator/titanium_mobile/pull/2980).
  7. Ingo Muschenetz 2012-09-19

    PR is against 3.0.0, not 2.1.3. I believe we may need a different PR.
  8. Ping Wang 2012-09-20

    The backport PR: https://github.com/appcelerator/titanium_mobile/pull/3006
  9. Olga Romero 2012-09-21

    Verified fix with: osx Mountain Lion 10.8.1 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK, build: 2.1.3.v20120920154617 Titanium SDK, build: 3.0.0.v20120921144915 Device: Galaxy S3 (4.0.4)
  10. Tamila Smolich 2012-10-11

    Reopening issue, since the row is not displayed. Tested on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 3.0.0.201210090117 Titanium SDK, build: 3.0.0.v20121010184612 Device: Samsung Galaxy Nexus (4.1.1) Regression, does not occur on 2.1.3.
  11. Allen Yeung 2012-10-13

    Looks like this is working on the latest version of master and 3_0_X.
  12. Tamila Smolich 2012-10-17

    Closing as fixed. Verified and tested on: Titanium Studio, build: 3.0.0.201210151149 Titanium SDK, builds: 3.0.0.v20121017100120; 3.1.0.v20121017102121 Device: Nexus 7 (4.1.1)

JSON Source