[TIMOB-9385] iOS: Implement conditional horizontal layout wrapping
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-06-18T12:37:27.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Release 2.1.0, Sprint 2012-12 Core |
Components | iOS |
Labels | core, layout, look1, parity |
Reporter | Max Stepanov |
Assignee | Max Stepanov |
Created | 2012-06-05T13:20:17.000+0000 |
Updated | 2017-03-16T22:52:30.000+0000 |
Description
*horizontalWrap:boolean* property will control warp/no-wrap (default is true)
// all color boxes should be contained within one row (no wrapping)
var win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});
var parent = Ti.UI.createView({backgroundColor:'red',layout:'horizontal', horizontalWrap: false, width:Ti.UI.SIZE, height:300})
var child1 =Ti.UI.createView({backgroundColor:'green',height:60,width:130});
var child2 =Ti.UI.createView({backgroundColor:'blue',height:120,width:170});
var child3 =Ti.UI.createView({backgroundColor:'#eee',height:120,width:50});
var child4 =Ti.UI.createView({backgroundColor:'#666',height:60,width:50});
parent.add(child1);
parent.add(child2);
parent.add(child3);
parent.add(child4);
win.add(parent);
win.open();
Ti.API.info("Default HorizonalWrap is "+child1.horizontalWrap);
Ti.API.info("HorizonalWrap for parent is "+parent.horizontalWrap);
PR pending https://github.com/appcelerator/titanium_mobile/pull/2369
Closing ticket as fixed.