4 Replies Latest reply on Jul 5, 2012 12:13 PM by byoder7

    Label width in an item renderer


      In the following example, the first label in the item renderer is supposed to truncate long text to fit. However, it is not doing so and is instead pushing the second label outside of the viewing area. Any suggestions on how I can fix this?


      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
              <s:ArrayCollection id="testData">
                  <fx:Object name="Short name" count="0" />
                  <fx:Object name="ReallyLongNameIHopeThisGetsTruncatedLetsSee" count="2" />
              <!-- Place non-visual elements (e.g., services, value objects) here -->
          <mx:List width="150" dataProvider="{testData}">
                      <mx:Canvas width="100%" height="25" horizontalScrollPolicy="off">
                          <mx:HBox width="100%" horizontalScrollPolicy="off">
                              <mx:Label text="{data.name}" width="100%" truncateToFit="true"/>
                              <mx:Label text="{data.count}" width="30" textAlign="right" />