【问题标题】:Flex toolbar elementFlex 工具栏元素
【发布时间】:2012-05-14 08:31:19
【问题描述】:

Flex 中是否存在类似 c# ToolBar 的 Toolbar (http://msdn.microsoft.com/en-us/library/ms752063.aspx)

我正在使用 HBox 和 clipAndEnableScrolling = true

但是当内容更宽时我需要滚动,就像 c# 一样

【问题讨论】:

    标签: apache-flex actionscript toolbar flex-mx


    【解决方案1】:

    默认情况下,没有。不过,其他人可能已经构建了一些组件。我总是根据需要自己滚动。我可能会做类似下面的事情。我相信有更好的方法,但蛮力可以满足我的需求,希望它会对你有所帮助。

    <s:HGroup width="100%">
            <s:Button label="scroll left" click="scrollLeftClick()"/>
            <s:Scroller width="100%" horizontalScrollPolicy="off">
                <s:HGroup>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    ...//as many more buttons as needed
                </s:HGroup>
            </s:Scroller>
            <s:Button label="scroll right" click="scrollRightClick()"/>
        </s:HGroup>
    

    然后作为分隔符,您始终可以在按钮之间使用以下内容:

    <s:Line height="100%">
                        <s:stroke>
                            <s:SolidColorStroke weight="2"/>
                        </s:stroke>
                    </s:Line>
    

    然后只需为 scrollLeft 和 scrollRight 添加函数来移动 scrollerPosition 并且世界上一切都会正确......无论如何理论上都是这样。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-01
      • 1970-01-01
      相关资源
      最近更新 更多