开发者

Actionscript3, Adobe Air for mobile: Alternative for bordercontainer?

I am using adobe air to create a mobile application.开发者_运维百科 I want to dynamically add a container or group that can contain some elements, and has a border and a background color. Since these are added dynamically, I use Actionscript 3. A bordercontainer works fine, however according to: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/BorderContainer.html this component is not meant to be used for mobile.

So my queston is: What lightweight component can contain other elements, and has a settable background color and border?


Try simply using the Group spark component. You would add a Rect with a filled background and a solid line:

<s:Group>
  <s:Rect>
     <s:stroke>
        <s:SolidColorStroke />
     </s:stroke>
     <s:fill>
        <s:SolidColor />
     </s:fill>
  </s:Rect>
</s:Group>

For an additional performance enhancement, you might want to look at FXG precompilation. Some article about that here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜