【转】[url]http://spy6.blogspot.com/2011/07/adding-background-to-mobile-flex-45.html[/url]
package skins
{
import models.Icons;
import mx.core.BitmapAsset;
import spark.components.Image;
import spark.skins.mobile.ViewNavigatorApplicationSkin;
public class AppSkin extends ViewNavigatorApplicationSkin
{
private var image:Image;
public function AppSkin()
{
super();
}
override protected function createChildren():void {
image = new Image();
image.source = (new Icons.background() as BitmapAsset);
image.height = 600; //Set image size here. You can also use percentWidth
image.width = 1024;
this.addChild(image);
super.createChildren();
}
}
}
@namespace s "library://ns.adobe.com/flex/spark";
s|View {
backgroundAlpha: 0;
}
本文介绍了一种在Flex 4.5中为移动应用程序设置背景的方法。通过自定义皮肤类AppSkin并继承自ViewNavigatorApplicationSkin,实现了背景图片的加载与尺寸设定。此方法适用于希望改善其Flex移动应用视觉效果的开发者。
1万+

被折叠的 条评论
为什么被折叠?



