2011-09-11 5 views
0

設定のポップアップをFlex 4.5アプリケーションに追加しようとしていますが、何らかの理由でFormヘルプの文字列がTitleWindowの外側に描画されるという問題があります。フォームに幅=「100%」高さ=「100%」を追加すると、何も変わりません:PopUpManager + TitleWindow + Form:helpContentがTitleWindowの外側に描画される

screenshot

誰がこのケースを処理する方法のアイデアを持っていてくださいますか?

以下は私の非常に簡単なテストコードです。 Flash Builder 4.5プロジェクトに貼り付けると、すぐに問題が表示されます。

SettingsTest.mxml:

<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" 
    xmlns:comps="*" 
    width="700" height="525" > 

    <fx:Script> 
     <![CDATA[ 
      import mx.managers.PopUpManager; 

      private function showSettings(event:MouseEvent):void { 
       var _settings:Settings = 
        PopUpManager.createPopUp(this, Settings, true) as Settings; 
       PopUpManager.centerPopUp(_settings); 
      }   
     ]]> 
    </fx:Script> 

    <s:Button right="10" bottom="10" label="Settings" click="showSettings(event)" /> 

</s:Application> 

Settings.mxml:

<?xml version="1.0" encoding="utf-8"?> 
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    width="400" height="300" 
    close="handleClose()" 
    creationComplete="init(event)"> 

    <fx:Script> 
     <![CDATA[ 
      import mx.events.FlexEvent; 
      import mx.managers.PopUpManager; 
      import flash.filters.ColorMatrixFilter; 

      private var _settings:SharedObject = 
       SharedObject.getLocal('settings'); 

      public function init(event:FlexEvent):void { 
       handleHide(null); 
      } 

      private function handleClose():void { 
       PopUpManager.removePopUp(this); 
      } 

      private function handleHide(event:Event):void { 
       var hide:Number = _hide.value; 
       _settings.data.hide = hide; 
       _settings.flush(); 

       if (hide >= 0.8) { 
        filters = null; 
       } else { 
        var matrix:Array = new Array(); 
        matrix = matrix.concat([1, 0, 0, 0, 1]);  
        matrix = matrix.concat([0, 1, 0, 0, 1]);  
        matrix = matrix.concat([0, 0, 1, 0, 1]);  
        matrix = matrix.concat([0, 0, 0, hide, 1]); 

        filters = [ new ColorMatrixFilter(matrix) ]; 
       } 
      } 
     ]]> 
    </fx:Script> 

    <s:Form width="100%" height="100%"> 
     <s:FormItem label="Invisible:">   
      <s:HSlider id="_hide" minimum="0.25" maximum="1.00" value="1.00" stepSize="0.25" change="handleHide(event)" /> 
      <s:helpContent> 
       <s:Label text="Make the game less visible at the screen" /> 
      </s:helpContent> 
     </s:FormItem> 
    </s:Form> 
</s:TitleWindow> 

答えて

1

これは、フォームの問題ではありませんが、私は信じているラベルの問題。ラベルにwidth="100%"を追加するか、ラベルに絶対幅を指定してください。

関連する問題