2013-06-25 32 views

回答

0

退房滾輪組件:Scroller API reference

你會想要把精靈的組,它實現了由滾輪所需的IViewport接口。

下面是一個簡單的例子,我從一箇舊的測試項目拉動:

<?xml version="1.0" encoding="utf-8"?> 
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" 
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" 
      applicationComplete="run()"> 
    <fx:Script> 
     <![CDATA[ 
      function run():void 
      { 
       var s1:Sprite = new Sprite(); 
       var s2:Sprite = new Sprite(); 

       s1.x = 100; 
       s1.y = 100; 
       s1.graphics.beginFill(0x00cc55); 
       s1.graphics.drawRect(0, 0, 100, 100); 
       s1.graphics.endFill(); 

       s2.x = 300; 
       s2.y = 300; 
       s2.graphics.beginFill(0x4400dd); 
       s2.graphics.drawRect(0, 0, 20, 20); 
       s2.graphics.endFill(); 

       display.addChild(s1); 
       display.addChild(s2); 
      } 
     ]]> 
    </fx:Script> 

    <s:Scroller id="theScroller" width="200" height="200"> 
     <s:Group id="theGroup"> 
      <s:SpriteVisualElement id="display" width="500" height="500"/> 
     </s:Group> 
    </s:Scroller> 
</s:Application> 
+1

這個問題沒有被標記爲Flex,所以不知道這是否會有所幫助。 – Marty

+0

好點:)很難說這個問題。 –

+0

我敢打賭,他沒有使用Flex ...這是一個初學者的問題。 – Pier

0

之前,我用這個自定義scrollbar.it的不錯的選擇,爲您的項目。 你可以找到源文件this url

相關問題