我正在为我的 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/