在利用UI编辑器导出的panel上addTouchEventListener(this.PanelDrag, this)事件,再给panel添加子结点cc.EditBox后,拖拽Panel时panel会消失,但是没有eidtbox就不会消失,不知道什么问题?求大神指点
你好,请问您在什么平台测试的呢?能否提供一个测试示例呢?
你好,不好意思回复晚了。
问题描述如下(windows平台下):
首先ccs.Layout.create()创建了一个容器,并增加监听事件panelDrag(面板的拖动),在不添加editbox的情况下是没有任何问题的;
再通过点击添加一个editbox后,这时再拖动panel就会出现父节点和editbox的背景图隐藏,可能是在setPosition是重绘导致的。
希望版主能够帮助解决这个问题。
panelDrag不是移除很久了?你这个引擎用的什么版本?
我用的是2.2.2的版本,panelDrag是我自己实现的
请检查是否是自己的控件有问题,目前cocostudio的gui已经吧dragpanel集成到了scrollview里了。
面板就是一个panel,面板消失后通过检测其实还是存在的,只是没有显示。问题就是添加了游戏引擎内的EidtBox造成的问题,添加EditBox后通过审查元素发现追加了嵌套很多层的DIV:
<div id="EGLViewDiv" style="position: absolute; width: 960px; max-height: 640px; margin: 0px; -webkit-transform: translate3d(0px, 0px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg); left: 0px; bottom: 0px;">
<div style="position: absolute; bottom: 0px; width: 960px; max-height: 640px; margin: 0px; -webkit-transform: translate3d(0px, 0px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg);">
<div style="position: absolute; bottom: 0px; width: 960px; max-height: 640px; margin: 0px; -webkit-transform: translate3d(0px, 0px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg);">
<div style="position: absolute; bottom: 0px; width: 960px; max-height: 640px; margin: 0px; -webkit-transform: translate3d(124px, -99px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg);">
<div style="position: absolute; bottom: 0px; width: 960px; max-height: 640px; margin: 0px; -webkit-transform: translate3d(0px, 0px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg);">
<div style="position: absolute; bottom: 0px; width: 960px; max-height: 640px; margin: 0px; -webkit-transform: translate3d(0px, 0px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg);">
<div style="position: absolute; bottom: 0px; width: 760px; max-height: 520px; margin: 0px; -webkit-transform: translate3d(0px, 0px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg);">
<div style="position: absolute; bottom: 0px; width: 100px; max-height: 40px; margin: 0px 0px -20px -50px; -webkit-transform: translate3d(100px, -200px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg); -webkit-transform-origin: 50px -20px; opacity: 1; visibility: visible;"> <div style="position: absolute; bottom: 0px; -webkit-transform: translate3d(3px, -3px, 0px) rotateZ(0deg) scale(1, 1) skewX(0deg) skewY(0deg); display: block; width: 94px; height: 34px; visibility: visible;">
<input type="text" style="font-size: 14px; color: rgb(255, 255, 255); border: 0px; background-color: transparent; width: 100%; height: 100%; outline: medium; background-position: initial initial; background-repeat: initial initial;">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
好的,根据你的说明来看是html5版本的问题,我已经将问题反馈给相关人员。感谢您的支持。
谢谢版主,有进展希望能告知。