单击 linkbaritem 时更改 LinkBarItem 的文本
我想创建一个自定义链接栏,其中所选项目在文本或其他任何内容之前显示有一些空格,如下图所示。
当选择第二个项目时,“二”会产生一些效果并稍微向左侧移动。
当选择第三个项目时,“三”会产生一些效果并稍微向左侧移动,“二”会在其原始位置移动。
请帮助我...
提前致谢
I want to create a custom LinkBar in which the item which is selected shown with some space before the text or anything else as shown in the Image below.
when second item is selected then Two is having some effect and move slightly to left side.
when third item is selected then Three is having some effect and move slightly to left side and Two move at its original place.
Please Help me ...
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个简单的应用程序演示了使用空格执行此操作的基本方法,它无论如何都不是防弹的,但它可以工作,并且它构建在 Flex SDK 3.6 上。
总之,它只是在所选项目标签的前面添加了一些空格。它通过每次链接栏调度项目单击事件时重置链接栏数据提供程序来实现此目的。然后为所选项目添加替换标签,删除旧标签。
感觉有点笨重,你可能可以用效果做一些更流畅的事情。
This simple application demos a basic approach to doing this with spaces, its not bullet proof by any means, but it works, and its build on Flex SDK 3.6.
In summary, it just adds some spaces onto the front of the item label selected. It does this by resetting the linkbars data provider each time the link bar dispatches the item click event. Then adding a replacement label for the selected item, removing the old one.
Feels a little clunky, and you could probably do something smoother with effects.
看看这个,这可能是一个很好的开始:
check this out, it could be a great beginning :