2012-01-03 57 views
1

我有两种形式的布局。我使用的是滚动条,但滚动条不对齐到窗口,但出现在应用程序屏幕中间的某处。如何在Adobe Flex中使用包含两种形式的滚动条?

<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        xmlns:mx="library://ns.adobe.com/flex/mx"> 
<s:Scroller width="601" height="539"> 

<s:Group > 

<s:Form x="5" y="10" > 
    <s:FormItem width="265" label="Name:" textAlign="right"> 
     <s:TextInput width="150"/> 
    </s:FormItem> 
      ... 
</s:Form> 
<s:Form x="300" y="10"> 
    <s:FormItem width="265" label="Color:" textAlign="right"> 
     <s:TextInput width="150"/> 
    </s:FormItem> 
      ... 
</s:Form> 

</s:Group> 
</s:Scroller> 
</s:WindowedApplication> 

下面您可以看到我的应用程序的屏幕截图。在边界没有滚动条。

View of the application

这里是屏幕截图与滚轮设置为宽度和高度为300像素。 正如您所看到的滚动条未连接到窗口。

view of smaller application

+0

如果你选择一个捕捉图像,这将是更容易理解 – kaissun 2012-01-03 16:20:53

+0

提供两个图像,希望这将有助于回答这个问题:) – pixel 2012-01-03 22:07:12

回答

1

如果你想在右边的滚动条,要在窗口的右侧,然后设置宽度为100%。身高相同。

如果您希望整个WindowedApplication滚动,请在属性选项卡上的WindowedApplication上滚动,或者添加完整宽度和高度的画布。

1

试图修改这样的代码:

<s:WindowedApplication 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="100%" height="100%"> 
<s:Scroller width="100%" height="100%"> 
<!--... the rest of the code--> 

应该工作。