Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3203] Android & iOS Bug: layout on view causes unexpected results

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionInvalid
Resolution Date2012-08-08T14:56:06.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labels1.6, android, bug, ios, layout, view
ReporterAlan Leard
AssigneeBlain Hamon
Created2011-04-15T03:39:22.000+0000
Updated2017-03-24T18:20:05.000+0000

Description

If you apply layout:'horizontal' to a view, the label disappears on iOS and is truncated in Android.

Test Code:


var win = Ti.UI.createWindow({
        backgroundColor: '#000'
});

var view = Ti.UI.createView({
    //layout:'horizontal',
    left:0,
    right:0
});

var label = Titanium.UI.createLabel({
    text:'TEST',
    color:'#000000',
    top:2,
    right:15,
    height:26,
    left: 15,
    backgroundColor:'#fff'
});

view.add(label);

win.add(view);

win.open();

remove comment for layout to test behavior.

Related HD Ticket: http://developer.appcelerator.com/helpdesk/view/74191">http://developer.appcelerator.com/helpdesk/view/74191

Comments

  1. Blain Hamon 2012-08-08

    Horizontal layout makes room by asking for the minimum needed. At time of writing, the minimum needed by a view with undefined width is '0'. As of 2.0, the minimum needed is Ti.UI.SIZE, which is much less than without horizontal layout. In short, marking invalid.
  2. Lee Morris 2017-03-24

    Closing ticket as invalid with reference to the above comments.

JSON Source