在下面的简单 Flex 移动测试用例中,为什么图标在列表中不可见?
截屏:
App.mxml(只需添加到 Flash Builder 4.7 中的空白 Flex 移动项目):
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
applicationDPI="160">
<fx:Declarations>
<s:MultiDPIBitmapSource id="EN_ICON"
source160dpi="@Embed('low-res/en_US.png')"
source240dpi="@Embed('mid-res/en_US.png')"
source320dpi="@Embed('high-res/en_US.png')"/>
<s:MultiDPIBitmapSource id="RU_ICON"
source160dpi="@Embed('low-res/ru_RU.png')"
source240dpi="@Embed('mid-res/ru_RU.png')"
source320dpi="@Embed('high-res/ru_RU.png')"/>
<s:MultiDPIBitmapSource id="DE_ICON"
source160dpi="@Embed('low-res/de_DE.png')"
source240dpi="@Embed('mid-res/de_DE.png')"
source320dpi="@Embed('high-res/de_DE.png')"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private const LANGUAGES:ArrayCollection = new ArrayCollection([
{ icon: EN_ICON, locale: 'en_US', label: 'English' },
{ icon: RU_ICON, locale: 'ru_RU', label: 'Русский' },
{ icon: DE_ICON, locale: 'de_DE', label: 'Deutsch' }
]);
]]>
</fx:Script>
<s:List
width="100%"
height="100%"
dataProvider="{LANGUAGES}">
<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer labelField="label" iconField="icon" />
</fx:Component>
</s:itemRenderer>
</s:List>
</s:Application>
图标(由用户koppi @ openclipart.org提供并放置在子目录中:src/low-res、src/mid-res、src/high-res):