Flex에 익숙하지 않고 ArrayCollection에 바인딩 된 TileList를 사용하고 있습니다. 로드 할 때 배열 컬렉션이 비어 있고 오전 HTTPService 호출의 결과로 업데이트됩니다. 문제는 항목 렌더러가 예상대로 렌더링되지 않는다는 것입니다.로드 타임에 처음 렌더링 될 때 데이터가 없었기 때문에 짐작할 수 있습니다. 여기서 간단한 예이다 :Flex :로드시 빈 ArrayCollection에 바인딩 된 구성 요소가 ArrayCollection이 업데이트 될 때 예상대로 렌더링되지 않습니다.
는<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var myList1:ArrayCollection = new ArrayCollection();
[Bindable]
public var myList2:ArrayCollection = new ArrayCollection([{item:"foo"}, {item:"bar"}]);
public function updateMyList():void
{
myList1.source = [{item:"foo"}, {item:"bar"}];
}
]]>
</mx:Script>
<mx:Button id="myButton" label="Update My List"
click="updateMyList();"/>
<mx:TileList dataProvider="{myList1}"
direction="vertical"
width="800" >
<mx:itemRenderer>
<mx:Component >
<mx:Canvas backgroundColor="yellow" >
<mx:Label text="{data.item}" width="800" />
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
<!-- This one renders as expected -->
<mx:TileList dataProvider="{myList2}"
direction="vertical"
width="800" >
<mx:itemRenderer>
<mx:Component >
<mx:Canvas backgroundColor="yellow" >
<mx:Label text="{data.item}" width="800" />
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Application>
하면 그 바인딩로드시 데이터가 (폭 800 픽셀)를 예상대로 렌더링 제 TileList 구성은 정확한 폭 아니며 주위 스크롤바를 가지고 렌더링 제 TileList 구성 비트 알 것이다.
아무도 왜 이것이 일어나고 있는지 또는 이것을 피하기 위해 몇 가지 해결 방법을 제공 할 수 있습니까?
감사합니다,
크리스