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