Looking for an answers on how to solve my ItemRenderer height 100% woes, I 
stumbled on this post (and subsequently FlexCoders!) and have a few questions.

After taking the advice below to override measure and set minHeight and 
invalidateSize() on my Text controls dataChange event, it appears to almost be 
working in giving me the right size hiding.

A few things I can't figure out, and maybe somebody could help answers, is it 
seems like the first item in the list upon load is way beyond the normal 
height.  It only looks normal after dragging the list down and back up again.  
I'm guessing it's coming from this added height:

measuredHeight = theTextID.textHeight + 40 ;

I can't seem to force it on creationComplete or anything like that.  Other than 
that, it looks like from time to time the same error occurs on other members of 
the list pretty randomly on the first few scrolls.

Getting close here!  Anyone have any ideas?

--- In flexcoders@yahoogroups.com, Fotis Chatzinikos <fotis.chatzini...@...> 
wrote:
>
> Have a look at the following bits of a working variableRowHeight item
> renderer (I am using it it to display conversation like comments on
> pictures):
> 
> <canvas>
>    <mx:TextArea
>             id="theTextID"
>             minHeight="0"
>             change="invalidateSize()"
>             color="#FFFFFF"
>             backgroundAlpha="0"
>             text="{comment.comment}"
>             textAlign="left"
>             fontWeight="bold"
>             borderStyle="none"
>             left="5"
>             right="5"
>             top="25"
>             bottom="5"
>             wordWrap="true"
>             editable="false"
>             />
> </canvas>
> 
> Pay attention to:
> 
> minHeight="0"                  //to accomodate for really short renderers
> change="invalidateSize()"  //re-measure on text change, for correct
> remeasuring on renderer recycling
> 
> The measure function:
> 
>             override protected function measure():void
>             {
>                 super.measure();
> 
>                 measuredHeight = theTextID.textHeight + 40 ;
>             }
> 
> 
> 
> On Wed, Feb 4, 2009 at 11:26 PM, Flap Flap <flapflapl...@...>wrote:
> 
> >   Hi there,
> >
> > Second night that I'm pulling my hairs on this stuff, I'm sure you will
> > give me some good hints.
> >
> > So, I have a custom list item render.
> > It's a VBOx with a GradientCanvas (width 100%, no height) child that have a
> > TextArea for child (width 100%, no height).
> > The GradientCanvas he's a custom component to have a advanced gradient
> > background.
> > The problem is one the TextArea.
> >
> > Here is the behavior that I'd like to have:
> >
> > When text is on several lines, the item renderer should update his height
> > to match the TextArea height.
> > At this moment, the TextArea display scrollbars.
> >
> > I've try with Label (but no multiline).
> > With UITextField, but not a mx component...
> > With Text component but the list act weird with this one...
> >
> > Can you point me to some clues ?
> >
> > thx
> >
> > BenoƮt Milgram / Flapflap
> > http://www.kilooctet.net
> >
> > I'm also a music mashup / bootlegs producer :
> > http://www.djgaston.net
> >  
> >
> 
> 
> 
> -- 
> Fotis Chatzinikos, Ph.D.
> Founder,
> Phinnovation
> fotis.chatzini...@...,
>


Reply via email to