我要定製一個MX滾動條的Flex 4自定義滾動欄| Tree組件是Flex 4中的 我想模仿這個功能:http://flexponential.com/2009/10/09/changing-the-position-of-the-scroll-bars-in-a-spark-list/上樹組件
任何想法或建議步驟?
我要定製一個MX滾動條的Flex 4自定義滾動欄| Tree組件是Flex 4中的 我想模仿這個功能:http://flexponential.com/2009/10/09/changing-the-position-of-the-scroll-bars-in-a-spark-list/上樹組件
任何想法或建議步驟?
這可以工作,添加你自己的錯誤檢查/造型,但你的想法:
<s:VGroup gap="-1">
<s:Button width="100%" label="Scroll up" click="{tree.verticalScrollPosition--}" />
<mx:Tree id="tree" labelField="@label" showRoot="false" width="300" height="150"
verticalScrollPolicy="off">
<mx:dataProvider>
<fx:XML>
<root>
<node label="Parent 1">
<node label="Child 1" />
<node label="Child 2">
<node label="Grandchild 1" />
<node label="Grandchild 2" />
</node>
<node label="Child 3" />
<node label="Child 4" />
<node label="Child 5" />
<node label="Child 6" />
<node label="Child 7" />
<node label="Child 8" />
<node label="Child 9" />
</node>
</root>
</fx:XML>
</mx:dataProvider>
</mx:Tree>
<s:Button width="100%" label="Scroll Down" click="{tree.verticalScrollPosition++}"/>
</s:VGroup>
絕對需要錯誤檢查,不是特別優雅,但這確實是我想要的。感謝您的建議。 – HJ05
你也可以嘗試使用verticalScrollBarStyleName/horizontalScrollBarStyleName用css樣式。但是它缺乏火花皮膚的舒適感。 ;)
這將是非常困難的一個mx組件。我不知道Spark Tree。 – JeffryHouser
你最好尋找一個Spark List組件,它更容易皮膚,你可以使用一個簡單的Scroller SkinClass。 – papachan