Seven Yu @ 03/26/2008 (4:07 am)

让你的自定义组件拥有自己的图标

通常, 我们使用自定义组件时, 列表中显示的是默认的一个很丑陋的图标(见右图).

今天在看一官方文档(Creating and Extending Adobe Flex 3 Components)时发现一个专门用来定义组件图标的元标签 [IconFile], 使用方法也非常简单:

PLAIN TEXT >> ACTIONSCRIPT:
  1. [IconFile("path/to/your/icon/filename.ext")]
  2. // 支持 png, gif 和 jpg 文件
  3. // 文件尺寸 18*18 px
  4. class YourClass{}

这样, 我们的自定义组件也有了自己的图标了, 够酷吧 ;)

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>