View Full Version : View with simplelayout
epopov
02-13-2004, 07:16 AM
Hi,
how to create view and simplelayout within that view dynamically, i.e. using new ?
Statically it looks like this:
<view>
<simplelayout />
</view>
antun
02-13-2004, 01:48 PM
If you have the destination view already, you can put the layout in a state that you can activate using the state's apply() method:
<canvas debug="true">
<view name="foo">
<state name="vertLayout">
<simplelayout axis="y" spacing="10" />
</state>
<view bgcolor="red" height="15" width="15" />
<view bgcolor="red" height="15" width="15" />
<view bgcolor="red" height="15" width="15" />
<view bgcolor="red" height="15" width="15" />
<view bgcolor="red" height="15" width="15" />
<view bgcolor="red" height="15" width="15" />
<view bgcolor="red" height="15" width="15" />
</view>
<button x="150">Apply simplelayout
<method event="onclick">
foo.vertLayout.apply();
</method>
</button>
</canvas>
-Antun
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.