3

拜托,任何人都可以帮我解决这个问题:下面的代码工作正常,直到我决定添加一个滚动条以获得更好的视图,突然,我得到了错误:

"Multiple initializer values for default property, 'viewport' of type 'spark.core.IViewport'"

谢谢

[CODE]

  <s:Scroller
    width="100%"
    height="100%"
    >

<s:Group id="basicDataGroup" includeIn="initial">

    <s:HGroup id="buttonGroup" 
              x="250" 
              paddingTop="20" 
              gap="15">
        <s:Button id="addBT" label="{resourceManager.getString('aggregationUI','add')}" click="addBT_clickHandler(event)"/>
        <s:Button id="delBT" label="{resourceManager.getString('aggregationUI','delete')}"/>
    </s:HGroup>

    <s:DropDownList id="languageCombo" 
                    prompt="{resourceManager.getString('aggregationUI','lang')}"
                    dataProvider="{new ArrayCollection([{locale:'fr_FI',label:'France'}, {locale:'en_US', label:'English'}])}"
                    change="languageChange(event)" 
                    width="100" 
                    x="473" 
                    y="20"/>

    <components:SearchComponent id="searchModel" searchClick="searchModel_searchClickHandler(event)"/>

    <components:DataComponent id="basicData" 
                              x="250" 
                              y="50"/>
</s:Group>

<s:Group id="newModelGroup" includeIn="newModel">
    <components:NewDataComponent id="newModelData"/>
    </s:Group>
</s:Scroller>
[/CODE]
4

1 回答 1

6

滚动条只能是一个组件的视口。在您的滚动条中,您有 basicDataGroup 和 newModelGroup。即使您有状态,因此它们不会同时存在,但我认为 Flex 并没有那么协调地知道这一点。相反,将这两个组包装在一个组中,并使该父组成为 Scroller 的视口。

希望有帮助,瑞安

于 2011-07-10T17:16:25.420 回答