Flex 創建一個自定義風格的HRule或VRule

Flex中如何通過strokeWidth, strokeColor和shadowColor樣式,創建一個自定義風格的HRule或VRule

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"
    verticalAlign="middle"
    backgroundColor="white">
 <mx:ApplicationControlBar dock="true">
  <mx:Form>
   <mx:FormItem label="stokeWidth:">
    <mx:HSlider id="strokeWidthSlider"
       minimum="0"
       maximum="20"
       value="2"
       liveDragging="true"
       snapInterval="1"
       tickInterval="1"
       dataTipPrecision="0"/>
   </mx:FormItem>
   <mx:FormItem label="strokeColor:">
    <mx:ColorPicker id="strokeColorColorPicker"
        selectedColor="red"/>
   </mx:FormItem>
   <mx:FormItem label="shadowColor:">
    <mx:ColorPicker id="shadowColorColorPicker"
        selectedColor="blue"/>
   </mx:FormItem>
  </mx:Form>
 </mx:ApplicationControlBar>
 <mx:HRule id="hrule"
     strokeWidth="{strokeWidthSlider.value}"
     strokeColor="{strokeColorColorPicker.selectedColor}"
     shadowColor="{shadowColorColorPicker.selectedColor}"
     width="100%"/>
</mx:Application>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章