简体   繁体   English

PhoneGap iOS应用上的页面加载闪烁

[英]Page load flickers on PhoneGap iOS app

My PhoneGap application uses slide in and slide out animations using entirely CSS animations. 我的PhoneGap应用程序使用完全使用CSS动画的滑入和滑出动画。

You can find the project I based my app on here . 您可以在此处找到基于我的应用程序的项目。

As you can see from the demo the slide transition is quite smooth, but as soon as I add images, after the new page is loaded it flickers/blinks for a fraction of second. 从演示中可以看到,幻灯片过渡非常顺畅,但是一旦添加图像,加载新页面后,它就会闪烁/闪烁一秒钟。 The interesting thing is that all the UI elements are shown on screen and then the flickers occurs. 有趣的是,所有UI元素都显示在屏幕上,然后发生闪烁。 More, sometimes the page scrolling becomes buggy and it doesn't let me scroll to the bottom of the page where my images are. 此外,有时页面滚动变得有问题,并且不允许我滚动到图像所在页面的底部。

I cached the images using CSS to improve image load but again no luck. 我使用CSS缓存了图像,以改善图像负载,但是还是没有运气。 I also found on different blogs about a similar issue on JQ mobile and tried adding without luck: 我还在不同的博客上找到有关JQ移动版上类似问题的文章,并尝试添加时不走运:

    webkit-backface-visibility: hidden;

You don't know how much I appreciate your help I spent my whole Saturday trying to figure this out. 您不知道我有多感谢您在整个星期六度过的时间来设法解决这个问题。

After some hours of fiddling I realized that the issue was because of the scrolling mechanism and fixed header which are poorly supported by -webkit browser. 经过几个小时的摆弄,我意识到问题是由于滚动机制和固定的标头所致,而-webkit浏览器却无法很好地支持它。 I am now using iscroll 5 and the issue disappeared. 我现在正在使用iscroll 5,问题消失了。

这是由于您的JS文件,如果您在html页面上加载了更多的js文件,那么当您在phonegap中开发应用程序时,您将需要一些时间才能在phonegap应用程序中找到该filck,然后尝试使用单页架构来开发必须是更好的选择,即使我遭受这个问题。

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

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