开发者

Find out if Flex component (tree) ist scrollable?

How can you find out if a Flex Component (in my case the tree) is scrollable? I tried it like this

if (_listOwner.height < _listOwner.measuredHeight) {
  // so stu开发者_StackOverflow社区ff
}

from within the tree's item renderer but didn't succeed. Access to the tree's scrollbar is private so that I can't get the info that way.


Found a solution by extending the tree class:

public class ExtendedTree extends Tree
{
    public function ExtendedTree()
    {
        super();
    }

    public function get isVerticalScrollable():Boolean
    {
        if (super.verticalScrollBar == null || super.verticalScrollBar.visible == false)
            return false;
        return true;
    }
}


Use the maxVerticalScrollPosition and maxHorizontalScrollPosition properties.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜