// Left + Right pins with undefined width (horizontal wrap). This should fill the row and have left/right padding. (green view) var win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'}); var parent = Ti.UI.createView({backgroundColor:'red',layout:'horizontal', horizontalWrap: true, width:Ti.UI.SIZE, height:300}) var child1 =Ti.UI.createView({backgroundColor:'green', left: 10,right:10,height:60}); var child2 =Ti.UI.createView({backgroundColor:'blue',right:100, top: 20, bottom: 10,width:170}); var child3 =Ti.UI.createView({backgroundColor:'#eee',height:120,width:50}); var child4 =Ti.UI.createView({backgroundColor:'#666', left: 20,height:60,width:170}); parent.add(child1); parent.add(child2); parent.add(child3); parent.add(child4); win.add(parent); win.open(); // Left + Right with defined width. When you switch to landscape mode, verify that the last view is also centered correctly // In landscape mode, since the parent has a bigger width, everything should be in one row, and centered var win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'}); var parent = Ti.UI.createView({backgroundColor:'red',layout:'horizontal', horizontalWrap: true, width:Ti.UI.SIZE, height:300}) var child1 =Ti.UI.createView({backgroundColor:'green', width: 40, left: 10,right:10,height:60}); var child2 =Ti.UI.createView({backgroundColor:'blue',right:100, top: 20, bottom: 10,width:170}); var child3 =Ti.UI.createView({backgroundColor:'#eee',height:120,width:50}); var child4 =Ti.UI.createView({backgroundColor:'#666', left: 20,height:60,width:170}); parent.add(child1); parent.add(child2); parent.add(child3); parent.add(child4); win.add(parent); win.open(); // Top + Bottom with undefined height. The green view should have fill behavior var win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'}); var parent = Ti.UI.createView({backgroundColor:'red',layout:'horizontal', horizontalWrap: true, width:Ti.UI.SIZE, height:300}) var child1 =Ti.UI.createView({backgroundColor:'green', width: 40, top: 10,bottom:10}); var child2 =Ti.UI.createView({backgroundColor:'blue',right:100, top: 20, bottom: 10,width:170}); var child3 =Ti.UI.createView({backgroundColor:'#eee',height:120,width:50}); var child4 =Ti.UI.createView({backgroundColor:'#666', left: 20,height:60,width:170}); parent.add(child1); parent.add(child2); parent.add(child3); parent.add(child4); win.add(parent); win.open();