Jul 19
接下来的例子演示了Flex中如何利用ProgressBar.labelPlacement属性,在一个进度条(progress)中指定标签位置。
让我们先来看一下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:Label text="ProgressBar.labelPlacement" />
- <mx:HBox>
- <mx:VBox>
- <mx:RadioButtonGroup id="rbg" />
- <mx:RadioButton label="left" group="{rbg}" />
- <mx:RadioButton label="center" group="{rbg}" />
- <mx:RadioButton label="right" group="{rbg}" />
- <mx:RadioButton label="top" group="{rbg}" />
- <mx:RadioButton label="bottom" group="{rbg}" />
- </mx:VBox>
- <mx:VBox backgroundColor="white"
- horizontalAlign="center"
- verticalAlign="middle"
- width="200" height="100%">
- <mx:ProgressBar id="progressBar"
- barColor="haloOrange"
- label="{rbg.selectedValue}"
- labelPlacement="{rbg.selectedValue}"
- mode="manual"
- width="150"
- creationComplete="progressBar.setProgress(50, 100)" />
- </mx:VBox>
- </mx:HBox>
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:minidxer
