It's at least hairy squared...

I think the magic in ListItemRenderer for setting the height is in these lines 
in the measure() method, specifically in the assignment of the measuredHeight 
property (description is my UITextField component):

if (isNaN(explicitWidth)) {
  w += description.getExplicitOrMeasuredWidth();
  measuredWidth = w;
  measuredHeight = description.getExplicitOrMeasuredHeight();  //<== critical 
assignment
}
else  {
  measuredWidth = explicitWidth;
  description.setActualSize(Math.max(explicitWidth - w, 4), description.height);
  measuredHeight = description.getExplicitOrMeasuredHeight(); //<== and here
}

I have not studied them in detail yet.

Tracy

________________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Alex 
Harui
Sent: Friday, September 07, 2007 5:32 PM
To: [email protected]
Subject: RE: [flexcoders] Re: Unwanted scrollbars on my List 
itemRenderer--measure() help?

It should only be one level of hairy, not three...
 
When your renderer's measure() method gets called, the List will have set its 
explicitWidth property to give you a clue as to how wide it is going to be.  
You should use that to help determine the height of the text.  ListItemRenderer 
does that today using UITextField instead of the heavier and slower Text.
 
I'm still poking around at how image loading affects measure.  Not sure there's 
any good answer.

________________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of David 
Ham
Sent: Friday, September 07, 2007 2:25 PM
To: [email protected]
Subject: [flexcoders] Re: Unwanted scrollbars on my List 
itemRenderer--measure() help?
Alex,

> You also have a Text in there which also may not measure out correctly.
> 
> ListItemRenderer will be much faster than HBox, but you'll have to do
> more in AS than MXML.
> 
> Can you draw up a picture of what you want the renderer to look like?
> Are images of a known size?

If the image is present, it is of one of a few sizes. The text is a
bigger problem. Basically, the format is:

[Image] (Item title: 1-2 lines of text)
(Item abstract: 1-10 lines of text)
(Item source: 1 line of text)

Sort of like on YouTube, a thumbnail on the left and a title and the
title and description on the right. But the description can be a
variable size.

Working on doing it with a ListItemRenderer, and am deep inside the
createChildren, measure, commitProperties, and updateDisplayList
methods. Hairy, hairy, hairy.

Anything you can suggest will be greatly appreciated. Thanks,

OK
DAH
 

Reply via email to