简体   繁体   English

我的Tizen应用在点击时会闪烁

[英]My Tizen app flickers upon tapping

I'm building a JavaScript Tizen app for Gear S2 In an earlier stage of development I considered using Angular, but I just ignored the possibility entirely because ng-click events made the screen flicker. 我正在为Gear S2构建JavaScript Tizen应用程序。在开发的早期阶段,我考虑过使用Angular,但是我只是完全忽略了这种可能性,因为ng-click事件会使屏幕闪烁。

I kept building the app without any issues, my click event worked fine! 我一直在构建应用程序,没有任何问题,我的点击事件运行良好! Until I incorporated jQuery mobile and suddenly my app now flickers when I "tap" the emulator. 直到我合并了jQuery mobile,然后突然“点击”模拟器时我的应用程序才闪烁。 I tried binding the event in 3 different manners, with the same result: 我尝试以3种不同方式绑定事件,结果相同:

window.addEventListener("click", callback); // way 1
$(document).bind("click", changeMode); // way 2
$(document).bind("tap", changeMode); // way 3

does anyone have a clue of why this might be happening? 有谁知道为什么会这样吗?

When do you bind the click event? 您何时绑定click事件? Maybe you add the listener multiple times, so your Callback is also triggered multiple times. 也许您多次添加了侦听器,所以您的回调也会被触发多次。
Also why add the click listener to the window/document instead of a proper element? 还要为什么将点击侦听器而不是适当的元素添加到窗口/文档?

I would also prefer to use ".on()" and ".off()" instead of bind. 我也希望使用“ .on()”和“ .off()”代替绑定。

Maybe you can share some of your code so we can "see" the problem? 也许您可以共享一些代码,以便我们“看到”问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM