自定义列表设计 - Adob​​e Flex

时间:2011-04-01 14:51:23

标签: flex actionscript adobe mxml

过去几天一直在使用Adobe Flex中的人物搜索应用程序来处理 Blackberry Playbook 。基本上我有以下内容:

底部有MXML界面的主应用

private var persons:ArrayCollection = new ArrayCollection();

public function init():void{    

   var p1:PersonSummary = new PersonSummary("Joe Smith", "9/9/1987", "img1.jpg");
   var p2:PersonSummary = new PersonSummary("Ben Smith", "9/5/1987", "img2.jpg");
   var p3:PersonSummary = new PersonSummary("John Doe", "9/9/1967", "img3.jpg");

   persons.add(p1); 
   persons.add(p2);
   persons.add(p3);
}

PersonSummary

class PersonSummary{

   private var name:String;
   private var dob:String;
   private var image:String;

   public function PersonSummary(n:String,d:String,i:String){
          this.name = n;
          this.dob = d;
          this.image = i;
   }
...
}

我正在寻找的界面:

enter image description here

什么是MXML?生病的永远是我能为这个问题解决这个问题的人的债务!

由于 菲尔

1 个答案:

答案 0 :(得分:1)

使用ItemRenderer mxml的提示是使用ItemRenderer mxml,其中包含您想要的详细信息。图像显示,名称,DOB。您可以在界面构建器中构建它。

其次你需要第二个mxml,它声明一个带有List里面的VBOX,然后列表应该绑定到你的ArrayCollection,并且每个项目都会在你为列表中的每个项目构建的项目渲染器中被拾取。

很抱歉,这不是一个编码示例。