[]打包为APP后,Lable的宽高有所变化,请问如何修正?
打包为APP后,Lable的宽高有所变化.请问是什么原因造成的.该如何统一?
测试代码:
public function LayaSample() {
//初始化引擎
Laya.init(1280, 720,WebGL);
Laya.stage.bgColor = "#FFF";
var demo:demoUI = new demoUI();
Laya.stage.addChild(demo);
var demoLable1:Label = new Label();
demoLable1.text = "一二三四五六七八九十";
demoLable1.fontSize = 50;
demoLable1.bgColor = "#00F";
demo.addChild(demoLable1);
var demoLable2:Label = new Label();
demoLable2.text = "上个Lable的宽: " + demoLable1.width + ", 高: " + demoLable1.height;
demoLable2.fontSize = 50;
demoLable2.bgColor = "#0FF";
demo.addChild(demoLable2.pos(0,50));
}
测试代码:
public function LayaSample() {
//初始化引擎
Laya.init(1280, 720,WebGL);
Laya.stage.bgColor = "#FFF";
var demo:demoUI = new demoUI();
Laya.stage.addChild(demo);
var demoLable1:Label = new Label();
demoLable1.text = "一二三四五六七八九十";
demoLable1.fontSize = 50;
demoLable1.bgColor = "#00F";
demo.addChild(demoLable1);
var demoLable2:Label = new Label();
demoLable2.text = "上个Lable的宽: " + demoLable1.width + ", 高: " + demoLable1.height;
demoLable2.fontSize = 50;
demoLable2.bgColor = "#0FF";
demo.addChild(demoLable2.pos(0,50));
}
没有找到相关结果
已邀请:
1 个回复
Aar0n
赞同来自: 黑白