[0]引擎示例中的错误
引擎示例-2D-DOM元素-表单输入,有1处问题
链接:https://layaair2.ldc2.layabox. ... DForm
1、constructor里的最后一行:
Laya.stage.on(Laya.Event.RESIZE, this, this.fitDOMElements, [emailInput, birthdayInput, passwordInput]);
当stage调整尺寸时,对3个input位置进行调整,当初次运行时,3个input框排在网页左上角,必须手动改变一下浏览器大小才会触发这个事件。
链接:https://layaair2.ldc2.layabox. ... DForm
1、constructor里的最后一行:
Laya.stage.on(Laya.Event.RESIZE, this, this.fitDOMElements, [emailInput, birthdayInput, passwordInput]);
当stage调整尺寸时,对3个input位置进行调整,当初次运行时,3个input框排在网页左上角,必须手动改变一下浏览器大小才会触发这个事件。
说明初次运行时,并没有触发Event.RESIZE事件,所以位置在左上。
这只是一个展示DOM元素的示例,如果想初始运行位置对的话,
可以在constructor里的最后一行手动调用一次this.fitDOMElements()方法。
这只是一个展示DOM元素的示例,如果想初始运行位置对的话,
可以在constructor里的最后一行手动调用一次this.fitDOMElements()方法。
要回复问题请先登录
伍德春 • 2022-12-06 09:50
请问,除了官网提供的示例可以学习外,其它还有途径查看示例学习不,市面上就一本书。
小高 • 2022-12-06 10:11
B站也有我们的官方教学视频,https://space.bilibili.com/1736809941