设置Slider组件TIP的偏移量.

dataTipOffset样式学习.
示例:

代码:

<? xml version="1.0" encoding="utf-8" ?>
<!--  http://blog.flexexamples.com/2008/05/09/setting-the-data-tip-offset-in-a-slider-control-in-flex/  -->
< mx:Application  xmlns:mx ="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white" >

    
< mx:Script >
        
<![CDATA[
            private function init():void {
                slider.value = slider.getStyle("dataTipOffset");
            }
        
]]>
    
</ mx:Script >

    
< mx:Form >
        
< mx:FormItem  label ="dataTipOffset:"  direction ="horizontal" >
            
< mx:HSlider  id ="slider"
                    minimum
="-10"
                    maximum
="30"
                    snapInterval
="1"
                    tickInterval
="5"
                    liveDragging
="true"
                    dataTipOffset
=" {slider.value} "
                    dataTipPrecision
="0"
                    showTrackHighlight
="true"
                    initialize
="init();"   />
            
< mx:Label  text =" {slider.value} "  width ="30"   />
        
</ mx:FormItem >
    
</ mx:Form >

</ mx:Application >

你可能感兴趣的:(slider)