ProgressBar有三种模式。其中当mode=event, indeterminate = true 时,进度条显示的是一种一直在加载的忙碌状态。可通过动态硬编码手动取消。
其他种类模式配合使用,则常用indeterminate = false。此时进度条显示的当前已加载的进度百分比。
1 <?xml version="1.0" encoding="utf-8"?> 2 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 3 layout="vertical" 4 verticalAlign="middle" 5 > 6 7 <mx:ApplicationControlBar dock="true"> 8 <mx:Form> 9 <mx:FormItem label="mode:"> 10 <mx:ComboBox id="comboBox"> 11 <mx:dataProvider> 12 <mx:Array> 13 <mx:Object label="event" /> 14 <mx:Object label="polled" /> 15 <mx:Object label="manual" /> 16 </mx:Array> 17 </mx:dataProvider> 18 </mx:ComboBox> 19 </mx:FormItem> 20 <mx:FormItem label="indeterminate:"> 21 <mx:CheckBox id="checkBox" selected="true" /> 22 </mx:FormItem> 23 </mx:Form> 24 </mx:ApplicationControlBar> 25 26 <mx:ProgressBar id="progressBar" 27 indeterminate="{checkBox.selected}" 28 mode="{comboBox.selectedItem.label}" /> 29 30 </mx:Application>