[LayaAir 2.0]发布Oppo小游戏屏幕适配bug

发布OPPO小游戏,进入游戏后是正常的,一旦切回后台再回来,UI就有问题了,使用的内嵌模式,初步发现有问题的都是view嵌套view的UI。
 
已邀请:

陈广文

赞同来自:

oppo 不能监听 下面的函数重置ui。注释掉就好了。自问自答,希望有用。
Laya.stage.on(Laya.Event.RESIZE, this, this.resize);
 
 
static resize(): void {
// let w = this.config.width;
// let h = this.config.height;
// let screen_wh_scale = Laya.Browser.clientWidth / Laya.Browser.clientHeight;
// if (Laya.stage.scaleMode == Laya.Stage.SCALE_FIXED_WIDTH) {
// h = this.config.width / screen_wh_scale;
// } else {
// w = this.config.height * screen_wh_scale;
// }
// Laya.Scene.unDestroyedScenes.forEach(element => {
// let s = element as Laya.Scene;
// s.width = w;
// s.height = h;
// });
}
 

要回复问题请先

商务合作
商务合作