开发者

how to make titleBar of Flash mx.containers.Panel invisible?

in FlashBuilder 4 beta 2, I've subclassed mx.containers.Panel, adding a public method to hide the titleBar:

    public function hideTitleBar(): void {

        if (null != this.titleBar){
            this.titleBar.visible=false;
        }
    }   

I step through the code and see that the method is being invoked and that titleBar exists, and then step through the UIComponent classes 开发者_JAVA技巧and that all looks ok too: the component is initialized and $visible is being set to false. Yet the gray bar across the top of the panel remains. I want to eliminate that bar and would be grateful for some tips on how to do that.


What I ended up doing is to set the style headerHeight to 0

this.setStyle("headerHeight", 0);


The updateDisplayList method of the Panel sets titleBar.visible to true. Subclass the Panel class, override that method, and set it to false inside that. Don't forget to call super.updateDisplayList

override protected function updateDisplayList(unscaledWidth:Number,
                                              unscaledHeight:Number):void
{
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    titleBar.visible = true;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜