<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.controls.ButtonLabelPlacement;
[Bindable]
[Embed('assets/flex_icon.gif')]
private var Icon:Class;
]]>
</mx:Script>
<mx:Label text="Button.labelPlacement" />
<mx:HBox>
<mx:Button id="bLeft"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bLeft.label}"
label="{ButtonLabelPlacement.LEFT}" />
<mx:Button id="bRight"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bRight.label}"
label="{ButtonLabelPlacement.RIGHT}" />
<mx:Button id="bTop"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bTop.label}"
label="{ButtonLabelPlacement.TOP}" />
<mx:Button id="bBottom"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bBottom.label}"
label="{ButtonLabelPlacement.BOTTOM}"/>
</mx:HBox>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.controls.ButtonLabelPlacement;
[Bindable]
[Embed('assets/flex_icon.gif')]
private var Icon:Class;
]]>
</mx:Script>
<mx:Label text="Button.labelPlacement" />
<mx:HBox>
<mx:Button id="bLeft"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bLeft.label}"
label="{ButtonLabelPlacement.LEFT}" />
<mx:Button id="bRight"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bRight.label}"
label="{ButtonLabelPlacement.RIGHT}" />
<mx:Button id="bTop"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bTop.label}"
label="{ButtonLabelPlacement.TOP}" />
<mx:Button id="bBottom"
width="120" height="100"
icon="{Icon}"
labelPlacement="{bBottom.label}"
label="{ButtonLabelPlacement.BOTTOM}"/>
</mx:HBox>
</mx:Application>
本文展示了一个使用Adobe Flex创建的应用程序示例,该程序演示了如何通过不同的布局选项来设置按钮上的图标和文本的位置。包括按钮的左、右、上、下四种布局方式。
3705

被折叠的 条评论
为什么被折叠?



