Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8282] Android: TableViewRow - TableViewRow does not shrink to height of content

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-04-02T12:39:07.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.1.0, Sprint 2012-07
ComponentsAndroid
Labelsapi, parity, qe-and031912, qe-nfc
ReporterWilson Luu
AssigneePing Wang
Created2012-03-24T13:43:33.000+0000
Updated2012-06-07T07:24:32.000+0000

Description

Steps to reproduce: 1. Run following code on Android:
var win = Ti.UI.createWindow();
win.backgroundColor = 'white';

var label = Ti.UI.createLabel({
	text: 'Pass if table view row width fills and height sizes to the content',
	top: 20,
	left: 10,
	height: 'auto',
	width: 'auto',
	color: 'black'
});
var table = Titanium.UI.createTableView({
	top: 50
});
win.add(table);

var row = Titanium.UI.createTableViewRow();
var row1 = Titanium.UI.createTableViewRow();
var row2 = Titanium.UI.createTableViewRow();
var row3 = Titanium.UI.createTableViewRow();

var view1 = Titanium.UI.createView({backgroundColor:'red',width:50,height:20});
var view2 = Titanium.UI.createView({backgroundColor:'red',width:50,height:50});
var view3 = Titanium.UI.createView({backgroundColor:'red',width:50,height:100});

row1.add(view1);
row2.add(view2);
row3.add(view3);
table.appendRow(row);
table.appendRow(row1);
table.appendRow(row2);
table.appendRow(row3);

win.add(label);

win.open();
Actual: Top TableViewRow does not constrain to height of content. See attachment. Expected: Top TableViewRow should constrain to height of content. Note: Above code works as expected on iOS

Attachments

FileDateSize
android.png2012-03-24T13:43:33.000+000032852
ios.png2012-03-24T13:43:33.000+000054082

Comments

  1. Tamila Smolich 2012-03-26

    Also occurs on: Device: Android Nexus S (2.3.6) Titanium Studio, build: 2.0.0.201203262445 SDK: 2.0.0.v20120325213306
  2. Sitara Shylaja 2012-03-26

    this also occurs on Android Nexus 1(2.2.2) on Titanium mobilesdk-2.0.0.v20120325213306 Titanium Studio build: 2.0.0.201203262445
  3. Satyam Sekhri 2012-03-26

    Also occurs on Kindle Fire and Nook Color Titanium SDK: 2.0.0.v20120325213306 Titanium Studio, build: 2.0.0.201203262445
  4. Shyam Bhadauria 2012-06-07

    Adding environment information Tested with Titanium SDK: 2.1.0.v20120606165259 Tested with Titanium Studio: 2.1.0.201206051612 Device: Android 2.2 and 4.0 Android Runtime: V8

JSON Source