2012-01-30 2 views

답변

2

사실, 우리 스타일의 일부인 비활성화 된 링크 버튼을 삼진으로 삼아 Flex 3에서 비슷한 문제가 발생했습니다. 그냥 코드를 체크 아웃하고 스파크 라벨에 대한 워드 프로세서를 보았고 mx 라벨에서 사용하고있는 함수가 [스파크 라벨의 measureText()에서 작동하지 않는다고 명시 적으로 밝혀졌습니다]라는 것을 알게되었습니다 :

이 UIComponent의 스타일에 의해 결정된 UITextFormat 을 사용하여 단일 행 UITextField (또는 UIFTETextField)에 표시된다고 가정하고 지정된 텍스트를 가져옵니다. UITextField (또는 UIFTETextField)를 사용하지 않기 때문에 Spark 구성 요소에서는 작동하지 않습니다. Spark 컴포넌트에 측정 텍스트는 A spark.components.Label의 측정 또는를 얻을 수 spark.components.RichText

그래서 나는 그것을 밖으로 생각을 다시 :

<?xml version="1.0" encoding="utf-8"?> 
<s:Label xmlns:fx="http://ns.adobe.com/mxml/2009" 
     xmlns:s="library://ns.adobe.com/flex/spark"> 
    <fx:Script> 
     <![CDATA[ 
      override protected function updateDisplayList(unscaledWidth : Number, unscaledHeight : Number) : void 
      { 
       super.updateDisplayList(unscaledWidth, unscaledHeight); 
       drawLines(); 
      } 

      private function drawLines() : void 
      { 
       var totalHeight : Number = 0; 
       for (var i : int = 0; i < mx_internal::textLines.length; i++) 
       { 

        totalHeight = mx_internal::textLines[i].y; 
        graphics.lineStyle(1, 0x000000); 
        graphics.moveTo(0, totalHeight); 
        graphics.lineTo(width, totalHeight); 
       } 
      } 
     ]]> 
    </fx:Script> 

    <fx:Declarations> 
     <!-- Place non-visual elements (e.g., services, value objects) here --> 
    </fx:Declarations> 
</s:Label> 
관련 문제