javascript - PhoneGap iOS 中页面之间出现白色闪烁/闪烁

标签 javascript ios xcode cordova

我正在为我的 iOS 应用程序使用phonegap。

出于某种原因,当我浏览我的应用程序时,页面之间会出现一瞬间的白色闪烁/闪烁。

我没有使用jquery mobile,我只使用了一些javascripts和iScroll4仅此而已。有办法解决这个问题吗?

已编辑
这是代码的一部分。

索引CSS:

body { 

-webkit-user-select: none; 
-webkit-touch-callout: none;
background-color: #f7f6ec;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
 }

#fixedcontent {
    position:absolute; z-index:1;
    top:64px; bottom:49px; left:0;
    width:100%;
    overflow:auto;
}

索引.html

<html>
    <head>


        <script type="text/javascript" src="cordova.js"></script>
        <link rel="stylesheet" type="text/css" href="css/index.css" />


       <!-- fixed header -->
       <script src="js/iscroll-lite.js"></script>
       <script type="text/javascript">

           var myScroll;
           function loaded() {
               setTimeout(function () {
                          myScroll = new iScroll('fixedcontent');
                          }

                          document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

                          document.addEventListener('DOMContentLoaded', loaded, false);

                          function onCompletion () {
                          // Here modify the DOM in any way, eg: by adding LIs to the scroller UL

                          setTimeout(function () {
                                     myScroll.refresh();
                                     }, 0);
                          };


                          </script>

    </head>

<body>
<div id="wrappercontentfixed"> hi test
<a href="about.html"> about page </a>
<a href="merchandise.html"> merchandise page</a>

</div>
</body>
</html>

最佳答案

造成这种情况的可能原因有很多。 也许是 webkit-tap-highlight-color您可以将具有闪烁效果的元素的 css 更改为 rgba(0, 0, 0, 0)

关于javascript - PhoneGap iOS 中页面之间出现白色闪烁/闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20936299/

相关文章:

javascript - react-native-dropdown-picker,如何修复其他组件上的下拉选择器覆盖

javascript - 如何从 html 调用指令

java - 如何强制用户更新应用?

java - 如何在Mac 10及以上版本发布Java应用程序7.0及以上版本?

javascript - 通过自定义组件将 props 添加到 styled-component

javascript - jQuery 随机无限旋转动画

ios - 动态改变 throttle 参数

ios - 在 swift(iOS) 中的文本字段内添加前缀

ios - iPhone5和iPhone 6图片后缀?

ios - 从 AppDelegate 问题访问 Storyboard ViewController