I'm trying to align some objects in the center of a view using the code:
row.height = 46; row.layout = 'horizontal'; var monthLabelContainer = Ti.UI.createView({ width:46, height:46, left:10, backgroundColor:'#CCC' }); row.add(monthLabelContainer); var assessmentsIndicatorContainer = Ti.UI.createView({ width:7, height:34, left:5, backgroundColor:'#CCC' }); row.add(assessmentsIndicatorContainer); var monthInfoContainer = Ti.UI.createView({ width:7, height:46, left:10, backgroundColor:'#CCC' }); row.add(monthInfoContainer);And this is the result: http://oi45.tinypic.com/2ur756w.jpg
As you can see, all the objects are alignes at the top of the container view.
If I remove the height of the "monthInfoContainer", everything is displayed as expected ... but I need to set an height to that object.
Am I missing something here?
1 Answer
This happens because of the horizontal layout. Try to wrap all the views in a parent view.
Your Answer
Think you can help? Login to answer this question!