Flex 3 中的滚动选项卡
我需要在flex3 中制作一个选项卡导航器。如果没有。选项卡的数量增加,然后我需要显示滚动条以在选项卡上导航。我正在尝试使用 tabBar 来做到这一点。但如果没有。 tab 的增加会将滚动条放置在 tabBar 及其内容的父级周围。而我只需要滚动选项卡而不是它的内容,就像在 Firefox 中一样。 有人可以建议我如何实现这一点吗?
提前致谢
I need to make a tab navigator in flex3. If no. of tabs increases then i need to show scrollbar to navigate over the tabs. I am trying to do this using tabBar. But if no. of tab increases it puts scrollbar around the parent of tabBar and its content. Whereas i need to scroll only tabs not its content like in firefox.
Could anybody please suggest me how could i accomplish this.
Thanks in Advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
放弃选项卡导航器。
使用 tabBar 切换视图堆栈的子项,将该选项卡栏放入一个框中,将框设置为特定宽度,然后当选项卡超出宽度时,该框将为您提供一个滚动条。您可以移动/设置滚动条的样式,以便可以将所有内容正确排列。
通过将 tabBar 与导航器(在本例中为视图堆栈)分离,您可以将其放在不同的父级中并获得您正在寻找的结果。
根据您的评论:
我没有例子,但这里有类似的东西:
http://fleksray.org/adobe_flex_components_en.html#Button%20Scrolling%20Canavas
这就是我的做法:
框 B 刚好足够容纳您的箭头图像,与框 D 相同。框 C 包含您的 tabBar,但将水平滚动策略关闭。所有这 3 个都放入 Box A 中,它可以是 HBox,以使布局更容易。将单击事件处理程序添加到箭头图像以设置 Box-c 的水平滚动位置 +=20 或 -=20,具体取决于您的箭头。 (更改这些数字以适合您)。您甚至可以加倍努力,将框 B 和 D 的 includeInLayout 属性设置为 false,除非您的 tabBar 占用的宽度超过框 C 的宽度。
Ditch the tab navigator.
Use a tabBar to toggle the children of a viewstack, put that tab bar inside a box, set the boxes to a specific width, then the box will give you a scroll bar when the tabs extend beyond the width. You can move/style that scrollbar so you can line everything up right.
By separating the tabBar from the navigator (in this case the view stack) you can put it in a different parent and get the result you're looking for.
As per your comment:
I don't have an example but there is something similar here:
http://fleksray.org/adobe_flex_components_en.html#Button%20Scrolling%20Canavas
This is how I would do it:
Box B is just big enough for your arrow image, same with box D. Box C contains your tabBar, but turn horizontalscrollpolicy to off. All 3 of these go into Box A which can be a HBox to make layout easier. Add a click event handler to your arrow images to set Box-c's horizontalscrollposition +=20, or -=20 depending on your arrow. (change those numbers to suit you). You can even go the extra mile and set the includeInLayout properties of boxes B and D to false unless your tabBar takes up more than the width of Box C.