简体   繁体   English

AS3 Flex Scroller-不滚动时隐藏

[英]AS3 Flex Scroller - Hide when not scrolling

I'm trying to figure out how to make a Flex Scroller not be offset and to be hidden when the user is not scrolling. 我试图弄清楚如何在用户不滚动时使Flex Scroller不偏移并隐藏。 Basically, I'd like for the Scrollbar to appear and be overlapping the content when the user is scrolling and to then disappear or fade out when the user has stopped scrolling. 基本上,我希望滚动条在用户滚动时出现并与内容重叠,然后在用户停止滚动时消失或淡出。

However, I've been unable to find any information online or any similar implementation on how to actually go about doing this. 但是,我一直找不到在线信息或有关如何实际执行此操作的任何类似实现。 I'd appreciate it if someone could point me in the right direction. 如果有人能指出我正确的方向,我将不胜感激。

Create a custom skinclass, inside that skin you add the following states: 创建一个自定义外观类,在该外观内添加以下状态:

<s:states>
    <s:State name="normal" />
    <s:State name="disabled" />
    <s:State name="inactive" />
</s:states>

Once that is done, you have two buttons: TRACK and THUMB. 完成后,您将有两个按钮:TRACK和THUMB。 Add this: 添加:

<!---  The default skin class is VScrollBarTrackSkin.  
        @copy spark.components.supportClasses.TrackBase#track 
        @see spark.skins.spark.VScrollBarTrackSkin -->
<s:Button id="track" top="0" bottom="0" height="54"
          focusEnabled="false"
          skinClass="com.happymetrix.client.mobile.components.uiLegacy.scroller.dark.DarkVScrollerTrackSkin"/>

<!--- The default skin class is VScrollBarThumbSkin.
        @copy spark.components.supportClasses.TrackBase#thumb 
        @see spark.skins.spark.VScrollBarThumbSkin -->
<s:Button id="thumb" 
          focusEnabled="false" visible.inactive="false"
          skinClass="com.happymetrix.client.mobile.components.uiLegacy.scroller.dark.DarkVScrollerThumbSkin" />

visible.inactive = "false"; visible.inactive =“ false”; Just try to play a bit with the custom skinclasses. 只需尝试使用自定义外观类即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM