Flex中如何给ButtonBar添加一个ViewStack的例子
By Minidxer | February 19, 2009
接下来的例子演示了Flex中如何给ButtonBar添加一个ViewStack。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:ButtonBar id="buttonBar"
- dataProvider="{viewStack}"
- buttonHeight="32" />
- <mx:ViewStack id="viewStack">
- <mx:VBox label="Button"
- icon="@Embed('assets/Button.png')"
- backgroundColor="white"
- width="480"
- height="60">
- <mx:Label text="Button..." />
- </mx:VBox>
- <mx:VBox label="ButtonBar"
- icon="@Embed('assets/ButtonBar.png')"
- backgroundColor="white"
- width="480"
- height="60">
- <mx:Label text="ButtonBar..." />
- </mx:VBox>
- <mx:VBox label="CheckBox"
- icon="@Embed('assets/CheckBox.png')"
- backgroundColor="white"
- width="480"
- height="60">
- <mx:Label text="CheckBox..." />
- </mx:VBox>
- <mx:VBox label="ColorPicker"
- icon="@Embed('assets/ColorPicker.png')"
- backgroundColor="white"
- width="480"
- height="60">
- <mx:Label text="ColorPicker..." />
- </mx:VBox>
- </mx:ViewStack>
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
ButtonBar |
No Comments » |
3,464 views
Tags: ButtonBar, dataProvider, ViewStack