一つの階層内での自動レイアウト配置です。等間隔になります。
<simplelayout/>を使うと、同一階層のオブジェクトを自動レイアウトします。デフォルトは縦方向。
<?xml version="1.0" encoding="UTF-8"?> <canvas proxied="false" bgcolor="0xeeeeee"> <simplelayout spacing="10"/> <view width="50" height="30" bgcolor="0xff0000"/> <view width="50" height="30" bgcolor="0x00ff00"/> <view width="50" height="30" bgcolor="0x0000ff"/> </canvas>
<vbox>は、<view>に<simplelayout/>の機能を加えたものです。
<?xml version="1.0" encoding="UTF-8"?> <canvas proxied="false" bgcolor="0xeeeeee"> <vbox spacing="10"> <view width="50" height="30" bgcolor="0xff0000"/> <view width="50" height="30" bgcolor="0x00ff00"/> <view width="50" height="30" bgcolor="0x0000ff"/> </vbox> </canvas>