Uniform Link Widths in Flex's LinkBar Component
Submitted by ben.bishop on Sun, 10/19/2008 - 02:20.
Problem:
You want the links in the LinkBar component to be the same width.
Solution:
Extend the LinkBar component to have a property called "linkWidth."
public class UniformLinkBar extends LinkBar
{
[Bindable]
public var linkWidth:Number = 50;
Override the createChildren method. In this method bind the new "linkWidth" property to each child's width.
override protected function createChildren():void{
super.createChildren();
for(var i:int = 0; i < this.numChildren; i++){BindingUtils.bindProperty(getChildAt(i), "width", this, "linkWidth");
}
}
To Implement:
<components:UniformLinkBar linkWidth="100">
Attached is the library project.
| Attachment | Size |
|---|---|
| UniformLinkBar.zip | 404.01 KB |
