Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8205] Android: Composite layout - horizontal layout Views don't position children correctly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-03-22T19:36:04.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsparity
ReporterNikhil Sharma
AssigneeNeeraj Gupta
Created2012-03-22T15:55:27.000+0000
Updated2017-03-09T23:20:56.000+0000

Description

Horizontal layout Views don't position children correctly.

Expected behavior

A red view at the top of the window (full width). An orange view occupying the left half of the red view. A blue square view immediately to the right of the orange view and vertically centered.

Repo Steps

1.Run the below code in app.js 2.You will see the blue view actually appears at position top=0
var win1 = Ti.UI.createWindow({  
    title:'Win 1',
    layout:'vertical',
    backgroundColor:'#fff'
});

var vw1 = Ti.UI.createView({
    layout:'horizontal',
    backgroundColor:'red',
    width:'100%',
    height:75
});
win1.add(vw1);

//
var TheOrange=Ti.UI.createView({height:75,
                                width:'160dp',
                                backgroundColor:'orange',
                                top:0
                               });

var GreenView=Ti.UI.createView({
          height:Ti.UI.SIZE,
          width:Ti.UI.SIZE,
          focusable:false,
          touchEnabled:false,
          backgroundColor:'green'
});

GreenView.add(TheOrange);
vw1.add(GreenView);

var BlueView=Ti.UI.createView({
    backgroundColor:'blue',
    width:50,
    height:50
});
vw1.add(BlueView);
//

win1.open();

Attachments

FileDateSize
ios_vs_android.png2012-03-22T15:55:28.000+000063984

Comments

  1. Opie Cyrus 2012-03-22

    Android behavior is correct in that the blue box is vertically center. Closing.
  2. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source