【问题标题】:PopUpManager + TitleWindow + Form: helpContent is drawn outside the TitleWindowPopUpManager + TitleWindow + Form:在TitleWindow之外绘制helpContent
【发布时间】:2011-11-14 16:27:47
【问题描述】:

我正在尝试向我的 Flex 4.5 应用程序添加一个设置弹出窗口,但有一个问题,即表单帮助字符串由于某种原因被绘制在 TitleWindow 之外。向表单添加 width="100%" height="100%" 不会改变任何内容:

有人知道如何处理这个案子吗?

下面是我非常简单的测试代码。如果将其粘贴到 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>

【问题讨论】:

    标签: apache-flex forms flex4 popup flex4.5


    【解决方案1】:

    我相信这不是表单问题,而是标签问题。尝试将width="100%" 添加到标签或在其上指定绝对宽度。

    【讨论】:

      猜你喜欢
      • 2011-02-18
      • 1970-01-01
      • 1970-01-01
      • 2013-06-11
      • 2013-02-21
      • 2011-08-03
      • 2012-06-17
      • 1970-01-01
      • 2011-08-31
      相关资源
      最近更新 更多