[TIMOB-13140] [android] label with height = T.UI.SIZE and no text not sizing correctly in layout
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2014-01-29T16:28:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, height, label |
Reporter | Martin Guillon |
Assignee | Ingo Muschenetz |
Created | 2012-10-15T07:34:33.000+0000 |
Updated | 2017-03-22T21:55:16.000+0000 |
Description
look at the test case, the second containing blue view should have an height of 0. Instead it has the height of the label as if it had text.
Replace the second label with a view and see how it should work
var win = Titanium.UI.createWindow();
win.backgroundColor = '#ccc';
var container = Ti.UI.createView({
height:70,
top:0,
layout:'vertical',
backgroundColor:'red'
})
var view = Ti.UI.createView({
height:Ti.UI.SIZE,
backgroundColor:'blue'
})
container.add(view);
var view2 = Ti.UI.createLabel({
height:Ti.UI.SIZE,
backgroundColor:'green',
text:'TEST'
})
view.add(view2);
win.add(container);
container = Ti.UI.createView({
height:70,
top:100,
layout:'vertical',
backgroundColor:'red'
})
view = Ti.UI.createView({
height:Ti.UI.SIZE,
backgroundColor:'blue'
})
container.add(view);
view2 = Ti.UI.createLabel({ //create a view instead here and it works
height:Ti.UI.SIZE,
backgroundColor:'green'
})
view.add(view2);
win.add(container);
win.open();
In Android textView, for simple text, layout (BoringLayout) assumes that the line count is 1 and the desired height is for this (if height is not specified).
Closing ticket as the issue mentioned here is not our bug.