3 Replies Latest reply on Sep 17, 2007 7:18 AM by zorglub76

    Problems with truncateToFit

    zorglub76
      Hi all
      I am creating a component which has a list with custom item renderer that looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%" height="31">
      <mx:Label id="key" text="{data.Key}" top="0" left="0" fontWeight="bold"/>
      <mx:Label id="summary" text="{data.Summary}" top="15" left="0" width="80%"/>
      </mx:Canvas>

      For some reason, text in "summary" label is not truncated and horizontal scroll bar appears (covering the complete text of the label).
      The same happens if I put right="20" instead of width="80%".
      But if the width is absolute (width="150"), text is truncated correctly.
      I also tried to make list's width absolute, but it didn't help.

      Any ideas?

      P.S. I also noticed that if I set canvas height to 32, then both horizontal and vertical scroll bars appear, but if I set it to the smaller or greater value, everything is ok (at least for those items that don't need truncating)...