how to resize on contained navigator change

how to dynamically resize a TitleWindow

 

Question:
I don’t know if anyone has tried this. I have a TitleWindow with no sizes
set in the popup manager call. Thus, it sizes to fit it’s initial content. I
have a Tab Navigator with 3 panes. The third pane has yet another navigator
( a combo box – don’t shoot me ) which then switches between ViewStack
panes. What I’d like to do is resize the window on this change. I’ve had a
look through the MXML / AS API and the book, and I haven’t really found
anything blatantly obvious.

Answer:
I found it! And it works beautifully... put this into a change handler in
the view helper for the component that you pass into the createPopUp()
method:

mx.managers.LayoutManager.invalidateLayout( mx.core.UIObject( view ) );

It causes the TitleWindow to inspect it's visible children and update it's
layout accordingly. The invalidate call should be in a doLater() call.

你可能感兴趣的:(navigator)