Adobe Flex 中的图像 [英] Images in Adobe Flex

查看:21
本文介绍了Adobe Flex 中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Adob​​e Flex/Actionscript 非常陌生,正在尝试创建个人搜索应用程序.到目前为止,我的结果显示为一个水平列表,但我想在每个名称上方包含一张图片,以展示我出色的绘画技巧:

Im very new to Adobe Flex/Actionscript and am trying to create a person search application. So far I have my results showing as a horizontal list, but Id like to include an image above each name as my wonderful paint skills show:

/* listOfPeople is a list of arrays with a["name"] a["sex"] a["dob"] and 
   a["image"] which is just a URI to the image */

<s:List width="100%" height="100%" id="results" dataProvider="{listOfPeople}" change="clickPerson(event)">
    <s:itemRenderer>
        <fx:Component>
            <s:MobileIconItemRenderer
                iconField="{data.image}"
                 iconHeight="100" iconWidth="100"
                label="{data.name} - {data.sex}"
                messageField="dob"/>
        </fx:Component>

    </s:itemRenderer>
    <s:layout>
        <s:HorizontalLayout paddingBottom="100" gap="6" paddingTop="100" paddingLeft="0"
            paddingRight="0"
            requestedColumnCount="-1"
            variableColumnWidth="true"
            verticalAlign="bottom"
            /> 
    </s:layout>
</s:List>

有什么想法吗?iconField 似乎根本没有显示......即使使用带有正确反斜杠的完整路径

Any ideas? The iconField doesn't seem to show at all... even when using the full path with correct backslashes

干杯菲尔

当点击此人时,图像在 PersonDetails 屏幕上显示良好:

The image displays fine on the PersonDetails screen, when the person is clicked upon:

<s:HGroup verticalAlign="middle" gap="12" paddingTop="10" paddingLeft="10">

    <s:Image source="{data.image}" height="170" width="170"/>

    <s:VGroup>
        <s:Label text="{data.name}"/>
        <s:Label text="{data.dOB}"/>
        <s:Label text="{data.sex}"/>
        <s:Label text="{data.birthplace}"/>
        <s:Label text="{data.colour} {data.ethnicity}"/>
        <s:Label text="{data.height}"/>
    </s:VGroup>

</s:HGroup>

推荐答案

我认为 MobileIconItemRenderer 以水平布局显示所有元素.如果要在文本顶部显示图像,则必须创建自己的渲染器或扩展 MobileIconItemRender 并更改其布局元素的方式

I think MobileIconItemRenderer displays all elements in a horizontal layout. If you want to display an image on top of the text, you have to create your own renderer or extends MobileIconItemRender and change the way it layouts its elements

这篇关于Adobe Flex 中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆