flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristina Constantinescu <cristina.constantine...@crispico.com>
Subject Re: Multiline LabelItemRenderer and maxWidth issue
Date Mon, 26 Aug 2013 10:37:08 GMT
Hi,

Does anyone know how flash.text.TextField textWidth & textHeight are 
calculated?

Thanks,
Cristina

On 23.08.2013 16:31, Alexander Farber wrote:
> Hello,
>
> here a Multiline renderer which works for me
> (yes I've noticed that 400px thing too...)
> and also see my Stackoverflow findings at
>
> http://stackoverflow.com/questions/15949378/multilined-itemrenderer-for-a-spark-components-list-with-test-case-and-screens
>
> package renderers {
> import spark.components.LabelItemRenderer;
>   public class MultiLine extends LabelItemRenderer {
> public static var IN_LOBBY:Boolean = false;
>   public function MultiLine() {
> super();
> minHeight = Preferans.ROW_HEIGHT;
> }
>   override protected function createChildren():void {
> super.createChildren();
> labelDisplay.multiline = true;
> labelDisplay.wordWrap = true;
> }
>   override public function set data(obj:Object):void {
> super.data = obj;
>   var label:String = obj.label as String;
>   if (IN_LOBBY) {
> var id:String = obj.id as String;
> var key:String = (id ? id.substr(0, 2) : 'DE');
> setStyle('color', Util.COLORS[key]);
> } else {
> var color:uint = (Util.isRed(label) ? 0xFF0000 : 0x000000);
> setStyle('color', color);
> }
> }
> }
> }
>
> Regards
> Alex
>


Mime
View raw message