Easy solution for one annoying HGroup/VGroup layout issue

Text elements in horizontal and vertical layouts are sometimes coward. When text is small, layout looks nice:

If the text is controlled by user and layout is not smart enough, it can look this way:


“Logout” button is invisible, search field is cropped.

It happens when HGroup or VGroup (horizontal/vertical layouts) are used since giving elements as much space as they require is their logical behavior. My colleague Nikita Petrov has shown me a very easy to avoid this:

5 responses to “Easy solution for one annoying HGroup/VGroup layout issue”

  1. [...] This post was mentioned on Twitter by Eric Snowden, fmchicago. fmchicago said: Easy solution for one annoying HGroup/VGroup layout issue: Text elements in horizontal and vertical layouts are so… http://bit.ly/c49EXH [...]

  2. This feature that you are talking about is called “label truncation”

    In Flex 4 you can set percentwidth on label instance to “100%” and specify maxDisplayedLines=”1″ on Label instance to get truncation working

    e.g.

  3. The code was eaten in the previous comment by HTML hungry worm.

    I reposted it on http://pastebin.com/Yk1Sa5zS

  4. One year after this post I’ve revisted your article and it was of great help to me to approach this annoying issue of HorizontalLayout not able to apply correct measurement regulations for Spark Label.

    Well, BasicLayout to the rescue then.

Leave a Reply