code_junkie

Best way to size containers in Flex to obey ONLY parent containers' explicit dimensions

Nov 11th, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. |------Container ------------|
  2. | explicitHeight: 400 (or whatever)
  3. | |
  4. | |-------- VBox -------| |
  5. | | percentHeight: 100 | |
  6. | | | |
  7. | | |-Repeater------| | |
  8. | | | Potentially | | |
  9. | | | a lot of stuff. | |
  10. |--|--|---------------|---|---|
  11.  
  12. public static function getFirstExplicitHeightInDisplayList(comp:UIComponent):Number{
  13. if (!isNaN(comp.explicitHeight)) return comp.explicitHeight;
  14. if (comp.parent is UIComponent) return
  15. getFirstExplicitHeightInDisplayList(UIComponent(comp.parent));
  16. else return 0;
  17. }
  18.  
  19. clipContent = true;
  20. verticalScrollPolicy = "off"
  21.  
  22. scrollRect = new Rectangle(x, y, w, h);
Add Comment
Please, Sign In to add comment