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

问题描述

我很新的Adobe Flex / Actionscript,并试图创建一个人的搜索应用程序。到目前为止,我的结果显示为一个水平列表,但我喜欢在每个名字上方包含一个图像作为我的精彩绘画技巧展示:

  / * listOfPeople是一个包含[name] a [sex] a [dob]和
a [image]的数组,它只是图像的URI * /

< s:itemRenderer>
< fx:Component>
< s:MobileIconItemRenderer
iconField ={data.image}
iconHeight =100iconWidth =100
label ={data.name} - { data.sex}
messageField =dob/>
< / fx:Component>

< / s:itemRenderer>
< s:layout>
paddingRight =0
requestedColumnCount = - 1
variableColumnWidth =true
verticalAlign =bottom
/>
< / s:layout>
< / s:List>

有什么想法? iconField似乎并没有显示出来,即使使用正确的反斜杠的完整路径



欢呼
Phil



编辑:

在人物被点击时,图片在PersonDetails屏幕上显示得很好:

 < s:HGroup verticalAlign =middlegap =12paddingTop =10paddingLeft =10> 

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

< s:VGroup>
< / s:VGroup>

< / s:HGroup>


解决方案

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

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>

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

CheersPhil

EDIT:

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>
解决方案

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中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 08:00