开发者

horizontal scrollbar issue on list and tree component

In the following example there is no horizontal scrollbar shown. As soon as I change horizontalScrollPolicy="auto" width horizontalScrollPolicy="on" it works fine. Anyone an idea whats wrong with this example?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

    <mx:ArrayCollection id="ac">
        <mx:Array>
            <mx:Object name="Text Text Text Text"/>
            <mx:Object name="Text Text Text Text"/>
        </mx:Array>
    </mx:ArrayCollection>

    <mx:List id="myList" width="100" height="1开发者_Go百科00" horizontalScrollPolicy="auto" maxWidth="100"
        dataProvider="{ac}"
        labelField="name"/>

     <mx:Tree width="100" height="100" horizontalScrollPolicy="auto" maxWidth="100"
        dataProvider="{ac}" labelField="name"  x="128" y="66"/>

</mx:Application>

thanks and regards

cyrill


Check this blog post: autoscrolling for flex tree

Quoting it:

The problem was that in a Tree (and other List-based components), when you set the horizontalScrollPolicy to auto, the scrollbars actually don't come out when they should. This seems like a bug at first, but we did this by design for performance reasons. In order to display the scrollbar properly, we need to measure the width of all the items (on-screen or not) and this would just take too much time to do by default. So instead, to get a scrollbar to show up, you need to set maxHorizontalScrollPosition, which is how much the user can scroll.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜