0
所以我的客戶有一個設計自己的FLEX皮膚導航,看起來像這樣: 的Flex 4.5菜單欄的垂直分隔符(使用的updateDisplayList)
我創建了一個自定義菜單欄來實現這一目標。但它似乎並沒有發生。它從不呈現我對圖形所做的任何更改。 我在做什麼錯?
這裏是我試過的方法:
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
this.graphics.clear();
for (var i:int = 1; i < this.menuBarItems.length; i++) {
var item:MenuBarItem = MenuBarItem(this.menuBarItems[i]);
this.graphics.beginFill(textColor);
this.graphics.drawRect(item.x + borderPadding, item.y, separatorSize, item.height);
this.graphics.endFill();
}
}
或:
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
this.graphics.clear();
for (var i:int = 1; i < this.menuBarItems.length; i++) {
var item:MenuBarItem = MenuBarItem(this.menuBarItems[i]);
item.graphics.beginFill(textColor);
item.graphics.drawRect(borderPadding, 0, separatorSize, item.height);
item.graphics.endFill();
}
}
的CSS,我有:
mx|MenuBar.navigation {
backgroundSkin: Embed(source="assets/A2AD00-1x1.png");
itemOverSkin: Embed(source="assets/8B9300-1x1.png");
color: #ffffff;
borderPadding: 0;
separatorSize: 1;
}