我正在使用 flex TitleWindow,并且我将其宽度和高度都设置为 100%。在这个 TitleWindow 中放置了一个数据网格。然而,无论我做了什么来改变窗口大小,它都没有得到反映。更改只是反映在 Eclipse 设计窗口中,而不是实际应用程序中。任何人都可以提出一些建议吗?
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%"
height="100%"
verticalScrollPolicy="off"
title="GanttChart"
xmlns:project="mpt.project.*"
showCloseButton="true"
close="closePopup()"
>
<mx:Script>
<![CDATA[
import mpt.vo.project.GanttChart;
import mx.collections.ArrayCollection;
import mx.managers.PopUpManager;
[Bindable]
private var styledEditor:IFactory=new ClassFactory(StyledItemEditor);
[Bindable]
private var dataForGanttGrid:ArrayCollection;//=new ArrayCollection([{title: "Task 1", start: 0, duration: 3, percentComplete: .7}, {title: "Task 2", start: 1, duration: 3, percentComplete: .5}, {title: "Task 3", start: 2, duration: 3, percentComplete: .3}, {title: "Task 4", start: 5, duration: 5, percentComplete: 0}]);
public function init():void
{
this.dataForGanttGrid=new ArrayCollection();
}
public function setDataForGanttGrid(title:String,start:int,duration:int,setPosition:int):void
{
this.dataForGanttGrid.addItemAt({title: title, start: start, duration: duration, percentComplete: .7},setPosition);
}
private function closePopup():void
{
PopUpManager.removePopUp(this);
}
]]>
</mx:Script>
<mx:VBox width="100%"
height="100%">
<project:GanttDataGrid width="100%"
height="100%"
max="10"
ganttItemEditor="{styledEditor}"
taskHeaderWidth="170"
dataProvider="{dataForGanttGrid}"/>
</mx:VBox>
</mx:TitleWindow>