2013-04-18 45 views
0

我有一个与我在Flex 4.6中开发的Web应用程序相关的小问题。Flex 4中的Web应用程序

我有一个应用程序,它具有800 x 600像素,并且在某些屏幕中,并非显示所有内容,并且浏览器中不显示任何滚动条。

如何设置应用程序能够在浏览器中显示y-scroll?

问候。

回答

1

我有类似的问题 - 与a card game为Flex 4的Web应用程序700×525像素 - 扮演主要由老人们,他们往往有字体/网页(通过使用CTRL和浏览器+键为例)放大 - 这引起了UI被偏移(像PopUpWindow不居中)等。

我的解决方案是使用自定义应用程序皮肤。

这里我的代码的一些摘录:

myApp.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" 
    width="700" height="525" 
    initialize="systemManager.stage.scaleMode=StageScaleMode.SHOW_ALL" 
    skinClass="MySkin"> 
    ... 

MySkin.mxml:(甚至工作在全屏模式下)

<?xml version="1.0" encoding="utf-8"?> 
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
     xmlns:s="library://ns.adobe.com/flex/spark" 
     xmlns:fb="http://ns.adobe.com/flashbuilder/2009" 
     xmlns:mx="library://ns.adobe.com/flex/mx"> 

    <fx:Metadata> 
    <![CDATA[ 
     [HostComponent("spark.components.Application")] 
    ]]> 
    </fx:Metadata> 

    <fx:Script fb:purpose="styling"> 
     <![CDATA[ 
      .... 
     ]]> 
    </fx:Script> 

    <s:states> 
     <s:State name="normal" /> 
     <s:State name="disabled" /> 
     <s:State name="normalWithControlBar" /> 
     <s:State name="disabledWithControlBar" /> 
    </s:states> 

    <s:Group id="mainGroup" x="0" y="0" width="700" height="525"> 
     <s:layout> 
      <s:VerticalLayout gap="0" horizontalAlign="justify" /> 
     </s:layout> 

     <s:Group id="contentGroup" width="700" height="100%" minWidth="0" minHeight="0" /> 

     <s:Group id="topGroup" minWidth="0" minHeight="0" 
        includeIn="normalWithControlBar, disabledWithControlBar" > 

      <s:Rect left="1" right="1" top="1" bottom="1" > 
       <s:fill> 
        <s:LinearGradient rotation="90"> 
         <s:GradientEntry color="#66BBEE" /> 
         <s:GradientEntry color="#3399CC" /> 
        </s:LinearGradient> 
       </s:fill> 
      </s:Rect> 

      <s:Rect left="2" right="2" bottom="0" height="1" alpha="0.5"> 
       <s:fill> 
        <s:SolidColor color="#333333" /> 
       </s:fill> 
      </s:Rect> 

      <s:Group id="controlBarGroup" left="0" right="0" top="1" bottom="1" minWidth="0" minHeight="0"> 
       <s:layout> 
        <s:HorizontalLayout paddingLeft="6" paddingRight="6" paddingTop="6" paddingBottom="6" gap="10" /> 
       </s:layout> 
      </s:Group> 
     </s:Group> 

    </s:Group> 
</s:Skin> 
+0

嗨亚历克斯,这不是我需要的目标,但谢谢你的回答。当然,我将在未来使用它。 – Apalabrados