开发者

Make scrollbars in List invisible

I'm using Adobe FLEX 4.5.1 for Mobile.

I have a List that displays some images:

<s:List id="imageList" initialize="init()" verticalScrollPolicy="off"     itemRenderer="skins.CustomIconItemRenderer" width="100" height="32" verticalCenter="0" horizontalCenter="0">
    <s:layout>
        <s:HorizontalLayout>
        </s:HorizontalLayout>
    </s:layout>
</s:List>

I want to make the horizontal scroll bars not visible but still be abl开发者_开发问答e to scroll.

I tried this in ActionScript:

imageList.scroller.horizontalScrollBar.visible=false;
imageList.scroller.horizontalScrollBar.alpha=0;
imageList.horizontalScrollPolicy= ScrollPolicy.OFF;

with no luck.


<fx:Metadata>
<![CDATA[ 
    /** 
     * @copy spark.skins.spark.ApplicationSkin#hostComponent
     */
    [HostComponent("spark.components.Scroller")]
]]>
</fx:Metadata> 

<fx:Script>
<![CDATA[    
    /**
     *  @private
     */
    override public function beginHighlightBitmapCapture() : Boolean
    {
        var needUpdate:Boolean = super.beginHighlightBitmapCapture();

        // Draw an opaque rect that fill our entire skin. Our background
        // is transparent, but we don't want focus/error skins to
        // poke through.  This is safe to do since we don't have any 
        // graphic elements as direct children.
        graphics.beginFill(0);
        graphics.drawRect(0, 0, width, height);
        graphics.endFill();

        return needUpdate;
    }

    /**
     *  @private
     */
    override public function endHighlightBitmapCapture() : Boolean
    {
        var needUpdate:Boolean = super.endHighlightBitmapCapture();

        // Clear the rect we drew in beginBitmapCapture();
        graphics.clear();

        return needUpdate;
    }
]]>
</fx:Script>

<!---  A vertical scrollbar that lets you control the portion of data that is displayed 
        when there is too much data to fit vertically in a display area.
        The Scroller determines whether the vertical ScrollBar is visible. -->
<!--<s:VScrollBar id="verticalScrollBar" visible="false" />-->

<!---  A horizontal scrollbar that lets you control the portion of data that is displayed 
        when there is too much data to fit horizontally in a display area.
        The Scroller determines whether the horizontal ScrollBar is visible. -->
<!--<s:HScrollBar id="horizontalScrollBar" visible="false" />-->

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜