flash - MXML: Spark skin a VGroups scrollbar -
i have vgroup automatically gets scrollbar if content gets long.
i skin scrollbar (make wider). how can that?
<s:panel title="replay" width="95%" height="860" top="920" horizontalcenter="0"> <s:vgroup id="vgroup" left="10" right="10" top="10" bottom="10"> <s:list id="list" height="100%" width="100%" itemrenderer="listrenderer" /> </s:vgroup> </s:panel>
first should know it's not vgroup gets scrollbar, it's list. groups layout components no visual elements whatsoever. (also vgroup redundant in code show, guess may have removed irrelevant code purpose of question.)
now skinning: creating own version of spark vscrollbarskin. if use flashbuilder, right-click on project (or package want create skin); click 'new > mxml skin'; in wizard fill in spark.components.vscrollbar host component , have create copy of spark.skins.spark.vscrollbarskin.

in class you've created, see 4 buttons, each own skin. 1 'scroll up' button, 'scroll down' button, third track (the background) clickable, , last thumb can drag.
you can create custom skin each of these buttons did vscrollbarskin, since want adjust width, may not necessary. may suffice set explicit width on each of these buttons.
now apply skin instead of default 1 put in stylesheet:
@namespace s "library://ns.adobe.com/flex/spark"; s|vscrollbar { skinclass: classreference("my.skins.vscrollbarskin") } or use more specific selector if want applied list scrollbars instance:
s|list s|vscrollbar { ... }
Comments
Post a Comment