Make the label width the width of the box like this

<mx:Box width="25%" id="myBox">

<mx:Label width="{myBox.width}"…………………

 

 

--N

 

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sergey Kovalyov
Sent: 23 October 2006 14:50
To: [email protected]
Subject: [flexcoders] truncateToFit does not work when percentWidth is defined for Label

 

Hi All!

I have a container and Label instance inside it. Unfortunately,
truncateToFit does not work if Label instance width is set in percent.
Please, take a look at the example below:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%"
height="100%">

<mx:Box width="25%">
<mx:Label width="100%" text="Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aenean ligula. Sed eget pede sed metus
nonummy rhoncus. Nam congue, tortor nec dignissim tincidunt, augue
odio volutpat sem, non vulputate lectus nulla vitae leo. Vestibulum
aliquet bibendum felis. Aenean in turpis mattis tellus tempus sodales.
Nulla sem. Maecenas lobortis pharetra lacus. Fusce non odio nec massa
auctor pharetra. Aenean vulputate posuere justo. Nulla vitae eros vel
eros aliquet euismod." />
</mx:Box>

</mx:Application>

On the other hand, if I assign fixed width to Label instance,
everything works ok:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%"
height="100%">

<mx:Box width="25%">
<mx:Label width="200" text="Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Aenean ligula. Sed eget pede sed metus nonummy
rhoncus. Nam congue, tortor nec dignissim tincidunt, augue odio
volutpat sem, non vulputate lectus nulla vitae leo. Vestibulum aliquet
bibendum felis. Aenean in turpis mattis tellus tempus sodales. Nulla
sem. Maecenas lobortis pharetra lacus. Fusce non odio nec massa auctor
pharetra. Aenean vulputate posuere justo. Nulla vitae eros vel eros
aliquet euismod." />
</mx:Box>

</mx:Application>

But in my case Label width should be set in percents.

Sergey.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to