试图删除最后一列中的额外空间,我尝试了各种方法,但没有任何效果,每当出现滚动条时,网格会以奇怪的方式表现,注意最后一列的宽度是 70,但不知何故网格会增加一些额外的空间。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.ResizeEvent;
import mx.collections.IViewCursor;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.managers.CursorManager;
[Bindable]
private var itemAC:Array = [
{name:"ABC", quantity:5, color:"Red", size:54, hasLogo:true},
{name:"ABC1", quantity:6, color:"Green", size:46, hasLogo:false}
];
]]>
</mx:Script>
<mx:Canvas width="25%" height="45%" backgroundColor="red" horizontalCenter="0"
verticalCenter="0" id="stuff" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:DataGrid height="100%" width="100%" id="dg" dataProvider="{itemAC}"
horizontalScrollPolicy="auto">
<mx:columns>
<mx:DataGridColumn width="70" dataField="name"/>
<mx:DataGridColumn width="70" dataField="quantity"/>
<mx:DataGridColumn width="70" dataField="color"/>
<mx:DataGridColumn width="70" dataField="size"/>
<mx:DataGridColumn width="70" dataField="hasLogo" resizable="false"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
</mx:Application>