這對我來說很奇怪,但我也是Spark的新手。我有一個帶有itemrenderer的List類。我怎樣才能讓itemrenderer在他們之間劃分List寬度?通常情況下,我認爲這將是一件容易的事,因爲給渲染者一個百分比寬度,但是沒有用處。有任何想法嗎?Flex Spark列表是否可以有100%寬度的itemrenderer?
應用:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
minHeight="600"
minWidth="955"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<s:ArrayCollection id="dta">
<fx:Object
label="one" />
<fx:Object
label="two" />
<fx:Object
label="three" />
<fx:Object
label="four" />
</s:ArrayCollection>
</fx:Declarations>
<s:List
width="100%"
borderColor="red"
dataProvider="{dta}"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
itemRenderer="ProgressIndicatorItemRenderer">
<s:layout>
<s:HorizontalLayout gap="0" />
</s:layout>
</s:List>
</s:Application>
的itemRenderer:
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer
width="100%"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
autoDrawBackground="false"
showsCaret="false">
<s:states>
<s:State name="normal" />
<s:State name="selected" />
<s:State name="done" />
</s:states>
<s:Rect id="progressIndicatorBackground"
left="0" right="0" top="0" bottom="0">
<s:fill>
<s:SolidColor
color.done="0xCCCCCC"
color.normal="0xCCCCCC"
color.selected="0xF6A139"
alpha="1" />
</s:fill>
</s:Rect>
<s:Label
width="100%"
text="{data.label}" />
</s:ItemRenderer>
嗨! 「分隔它們之間的列表寬度」是什麼意思? – Kodiak 2011-03-22 08:59:24