2010-05-11 3 views

답변

0

너비와 높이를 퍼센트로 시도 했습니까?

<mx:Label text="This is my text" width="100%" height="100%"/> 

가 지금까지 텍스트에 관한 한, 당신을 위해 here

/** 
    * Cheesy loop to find what should be the font size to fit the text in the inner rectangle 
    * This is invoked by creationComplete (or whenever you want to resize the font) 
    */ 
    private function resize():void { 
     var tf:TextField = lSpeech.mx_internal::getTextField(); 
     var textFormat:flash.text.TextFormat = tf.getTextFormat(); 

     while(tf.height > height * 0.707 && textFormat.size > 1 && labelFontSize > 1) { 
      textFormat.size = int(textFormat.size) - 1; 
      labelFontSize--; 
      tf.setTextFormat(textFormat); 
      lSpeech.validateNow(); 
     } 
     // repsition the label (vertical center) 
     lSpeech.y = (height - tf.height)/2 - 10; 
     lSpeech.height = tf.height; 
    } 
+0

감사 사용이 트릭을 확인, 내가 해결책을 얻을하지 마십시오 VBOX 안에 내가 레이블 및 텍스트와 이미지를 넣어 이미지는 올바르게 축소되지만 텍스트와 레이블은 내 라벨과 텍스트 폭, 높이 = "100"을 축소하지 않습니다. 다른 제안 사항은 무엇입니까? – aravinda

관련 문제