[LayaAirIDE 1.0]dialog的popup方法不会关闭其他弹窗
使用layaboxIDE版本1.7.22。
调用dialog对象里面的popup方法触发弹窗, 弹窗没有图层蒙版也没有关闭其他dialog
登录界面的代码:
class LoginView extends ui.loginUI {
normalDialog: NormalDialog;
constructor() {
super();
this.btn_signin.on(Laya.Event.CLICK, null, () => {
this.showDialog("登录成功")
});
this.btn_register.on(Laya.Event.CLICK, null, () => {
this.showDialog("注册功能暂未开放")
});
}
showDialog(context: string) {
// if (this.normalDialog) {
// this.normalDialog.close();
// }
this.normalDialog = new NormalDialog(context);
this.normalDialog.popup(true, true);
Laya.stage.addChild(this.normalDialog);
}
}
// 弹窗代码
class NormalDialog extends ui.normalDialogUI {
constructor(
text: string
) {
super();
// 设置label文字
this.context.text = text;
this.btn_close.on(Laya.Event.CLICK, this, this.close);
this.btn_success.on(Laya.Event.CLICK, this, this.close);
}
}
调用dialog对象里面的popup方法触发弹窗, 弹窗没有图层蒙版也没有关闭其他dialog
登录界面的代码:
class LoginView extends ui.loginUI {
normalDialog: NormalDialog;
constructor() {
super();
this.btn_signin.on(Laya.Event.CLICK, null, () => {
this.showDialog("登录成功")
});
this.btn_register.on(Laya.Event.CLICK, null, () => {
this.showDialog("注册功能暂未开放")
});
}
showDialog(context: string) {
// if (this.normalDialog) {
// this.normalDialog.close();
// }
this.normalDialog = new NormalDialog(context);
this.normalDialog.popup(true, true);
Laya.stage.addChild(this.normalDialog);
}
}
// 弹窗代码
class NormalDialog extends ui.normalDialogUI {
constructor(
text: string
) {
super();
// 设置label文字
this.context.text = text;
this.btn_close.on(Laya.Event.CLICK, this, this.close);
this.btn_success.on(Laya.Event.CLICK, this, this.close);
}
}
要回复问题请先登录
1 个回复
AerTims
赞同来自: