开发者

How do you set the background colour of a Spark IconItemRenderer?

开发者 https://www.devze.com 2023-03-06 06:17 出处:网络
I\'m almost embarrassed to ask this but I simply cannot get my head around it! I have the following list:

I'm almost embarrassed to ask this but I simply cannot get my head around it!

I have the following list:

    <s:List id="list" left="0" right="0" top="0" bottom="0"
        change="navigator.push开发者_如何学GoView(EmployeeDetails, list.selectedItem)" dataProvider="{data}" borderVisible="true" borderColor="0x000000" >
    <s:itemRenderer>
        <fx:Component>
                <s:IconItemRenderer label="{data.firstName} {data.lastName}" messageField="title" opaqueBackground="0x000000"/>
        </fx:Component>
    </s:itemRenderer>
</s:List>

How on earth do you get the background colour of the IconItemRenderer or itemRenderer to display? Everything I've tried results in a boring white background for each list item.

Regards, Daniel.


Managed to solve this by using "alternatingItemColors" with only one colour!


If I understand your problem correctly, I think you have to set the List autoDrawBackground property of the List to false.

0

精彩评论

暂无评论...
验证码 换一张
取 消