Home > Spark Layouts > VerticalAlign for VGroup and HorizontalAlign for HGroup

VerticalAlign for VGroup and HorizontalAlign for HGroup

January 24th, 2010 Leave a comment Go to comments

majoraxisalignment Recently I checked in the major axis alignment update to VGroup, HGroup, VerticalLayout, HorizontalLayout. It brings parity to the Flex 4 Spark layouts relative to the MX containers HBox and VBox that are well known from previous versions of Flex (and have had those alignment options for long time now).

Now VGroup and VerticalLayout have a “verticalAlign” property with the three supported values of “top“, “middle“, “bottom“. Accordingly HGroup and HorizontalLayout get a “horizontalAlign” property with the supported values of “left“, “center” and “right“. The alignment modes work for the layouts with and without virtualization enabled.
An important difference to note is that when “clipAndEnableScrolling” is set to “true” and the containers are scrolling (the content is bigger than the container), the Spark layouts ensure that the entire content can be scrolled in view by internally reverting to the “top“/”left” alignment respectively.

When playing with the attached sample, you’ll notice difference between the clipping and the non-clipping containers when scrolling is in effect (drag the slider left to force smaller height for the containers).

The sample was compiled with SDK version 4.0.0.13553, source: MajorAxisAlignment.mxml

  1. January 25th, 2010 at 01:19 | #1

    Nice, this was really needed to avoid have to use an extra Group that implement a layout on the other axis.

    Any reason why “justify” and “contentJustify” weren’t also implemented?

    i.e. on a VerticalLayout, “justify” would make all children the same height as the container, or “contentJustify” all children would be made the height of the largest child.

    I currently don’t see any errors if these unsupported values are set via AS (silently defaults back to “top” or “left”. Has this now changed and errors been added?

    • Evtim
      January 26th, 2010 at 00:20 | #2

      Hi Tink,

      Thanks for the comment. We didn’t implement “justify” or “contentJustify” as for example in a VerticalLayout with such verticalAlign settings, all of the elements will be as tall as the layout container. In that case the elements should be either stacked on top of each other (and the layout would no longer make sense to be called vertical) or arranged vertically (but then they won’t really be justified vertically).
      Having said that, I probably don’t understand your particular use case. Perhaps setting 100% height on all of the elements and using a BasicLayout instead is what you have in mind?

      Thanks,
      -Evtim

  2. February 23rd, 2010 at 10:12 | #3

    Hey Evtim,

    sorry for off-topic, can you contact me on my email (filled up, when submitting this comment). I really need to discuss with you bug http://bugs.adobe.com/jira/browse/SDK-25605 (you’ve created yesterday).

    Thanks in advance

  3. November 21st, 2015 at 08:00 | #4

    When using the DateField, how can I get the popup calendar to dipslay the current date upon opening the calendar regardless of what date is in the edit field? We use a default date of ’01/01/1900 instead of blank so when a user wants to change the ’01/01/1900 to something valid, he clicks the calendar and the year ’1900 is dipslayed. I would like the current month and year to be dipslayed instead of January 1900 . Thanks for your help.

  4. April 11th, 2016 at 01:13 | #5

    Wham bam thank you, ma’am, my questions are answered!

  5. June 5th, 2016 at 00:39 | #6

    Ithink the token should be something personal and important to you. Not something big because in the arena you have to run away from the enemys. A huge token would way you down.

  6. July 8th, 2016 at 07:12 | #7

    Tak Lærke :-) Jo den erTjah… Hvis du skal lægge et hvidt lag, sÃ¥ skal du alligevel have to lag ovenpÃ¥, og sÃ¥ har du tre lag alligevel… Det giver nok et lidt andet look, men prøv da at lege med det. Kunne være det var fint pÃ¥ en anden mÃ¥de.

  7. July 8th, 2016 at 07:19 | #8

    oh gosh, I meant to comment and completely forgot; not that you needed me to, it looks like you got a working plan.My son was never a good sleeper, ever. He needs company to go to sleep – when he goes to bed at night and if he wakes in the middle of the night. We’ve just dealt with it in the best way we figured was good for him to feel secure. Let’s just say, there are nights that it’s a good thing he has a single bed.Oh, and he pees like an elephant, too. Saturates EVERYTHING! (I thought it was just the cloth diapers … maybe it’s a boy thing)

  8. July 20th, 2016 at 08:09 | #9

    V guvax vg znl gnxr fbzr gvzr sbe gung gb fvax va. Bapr ur fgnegf GGG, ur znl fgneg gb guvax gung puncgref jvyy nygreangr. Ohg gurernsgre V nz rkcrpgvat gb urne va znal bs uvf erivrjf, NAQ JUNG NOBHG SEBQB NAQ FNZ????? NNNHHHTU!!!

  9. October 19th, 2016 at 09:31 | #10

    herkes bilir ki bir ilişkide aşk varsa yalan yoktur yalan varsa aşk yoktur.yalanı herkes söyler.bazıları ufa bzıları fazla büyüktür.büyük yalanlardan kaçınınız

  1. No trackbacks yet.