2 Replies Latest reply on Oct 27, 2009 10:36 AM by injpix

    spark.components.List...how to wordWrap?

    injpix Level 3

      How can I wordWrap text in a spark List component?  I understand that I can wordWrap a mx List component by using the wordWrap and variableRowHeight properties, but I want to use a spark List component.



        • 1. Re: spark.components.List...how to wordWrap?
          Peter deHaan Level 4



          In your Spark List, create a VerticalLayout and set the horizontalAlign property to "justify" (the default is contentJustify).


          <?xml version="1.0" encoding="utf-8"?>
          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

              <s:List width="150" left="20" top="20">
                      <s:VerticalLayout gap="0" horizontalAlign="justify" />
                          <fx:Object label="Lorem ipsum dolor sit amet, consectetur adipiscing elit." />
                          <fx:Object label="Fusce pulvinar nisi ac leo rhoncus nec malesuada arcu accumsan." />
                          <fx:Object label="Sed at metus eu mauris malesuada ornare." />
                          <fx:Object label="Vestibulum et ante non arcu facilisis sagittis." />
                          <fx:Object label="Praesent euismod bibendum tortor, pharetra pharetra nibh ultricies convallis." />
                          <fx:Object label="Sed at mi quis urna lobortis mattis." />
                          <fx:Object label="Nulla aliquet ante nec nisi auctor et pharetra leo blandit." />





          PS: I also posted a slightly modified version at http://blog.flexexamples.com/2009/10/27/setting-word-wrapping-on-a-spark-list-control-in-f lex-4/.


          Message was edited by: Peter deHaan (Adobe)

          • 2. Re: spark.components.List...how to wordWrap?
            injpix Level 3

            Ahhh...that works great!  Thanks again Peter.