3 Replies Latest reply on Oct 8, 2012 11:16 PM by Flex harUI

    TLF background color nigthmare

    P.o.l.a.c.o

      I have done this to test the background color style on tlf.

      The problem is that the background color does not take the whole textline height just the ascent + decent height ignoring the leading.

      I have attached an image of the current l&f and the desired one.

      Can someone point me in any direction to achieve this? I have been hours trying with style settings and nothing good happens.

       

      http://www.freeimagehosting.net/newuploads/q4pd2.jpg

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

          xmlns:s="library://ns.adobe.com/flex/spark"

          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="addText()">

        <fx:Declarations>

        <!-- Place non-visual elements (e.g., services, value objects) here -->

        </fx:Declarations>

       

        <fx:Script>

        <![CDATA[

        import flashx.textLayout.elements.TextFlow;

       

        import spark.utils.TextFlowUtil;

        private function addText():void{

        var myText:String = "<p><span lineHeight='120%'  backgroundColor='#000000' backgroundAlpha='1' color='#ffffff' fontSize='20'>Pitty title<br/>Pitty sub title</span></p>";

        var tft:TextFlow = TextFlowUtil.importFromString(myText);

        titleTextComp.textFlow = tft;

        }

        ]]>

        </fx:Script>

       

        <s:RichText id="titleTextComp" y="16" left="14" width="400" height="200" />

      </s:Application>