使列表中的滚动条不可见

发布于 2024-12-02 22:07:36 字数 687 浏览 3 评论 0原文

我正在使用适用于移动设备的 Adob​​e FLEX 4.5.1。

我有一个显示一些图像的列表:

<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>


我想让水平滚动条不可见,但仍然能够滚动。

我在 ActionScript 中尝试过这个:

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

但没有成功。

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 able to scroll.

I tried this in ActionScript:

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

with no luck.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

肥爪爪 2024-12-09 22:07:36
<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" />-->

<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" />-->

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文