- 注册时间
- 2014-7-28
- 最后登录
- 2015-5-27
- 阅读权限
- 30
- 积分
- 215
- 精华
- 0
- 帖子
- 60
|
上面的问题,经过测试后,总结了一下是这个BUG
一个小小的例子重现BUG:
var bg1= null;
function onframe()
{
if( bg1 == null )//生成红色的背景墙
{
bg1= new LSprite();
bg1.graphics.drawRect(1, "#ff0000",
[0, 0, screen_width, screen_height],
true,"#ff0000");
}
//问题在这里,重复2次removeAllchid和addChild的话 就没办法显示红色的背景墙
mapLayer.removeAllChild();
mapLayer.addChild(bg1);
mapLayer.removeAllChild();
mapLayer.addChild(bg1);
} |
|