使用CSS淡化UIWebView的底部 [英] Fade bottom of UIWebView using CSS
问题描述
我正在尝试淡出UIWebView在我的detailView的底部。它更像是最后20-40像素的衰落。我使用CSSTricks代码ReadMoreFade(链接)。我的简化版本粘贴在下面。
I'm trying fade out the bottom of the UIWebView in my detailView. It's more like fading last 20-40 px. I'm using CSSTricks code for "ReadMoreFade" (link). My simplified version is pasted below.
我的问题是当我开始在UIWebView中滚动,褪色区域像块一样停留在那里。我附上一个屏幕截图,显示这个。任何建议或提示?谢谢。
My problem is when I start scrolling in my UIWebView, faded area stays there like a block. I'm attaching a screenshot that shows this. Any suggestions or hints? Thank you.
SCREENSHOT:
http ://i51.tinypic.com/2rmxsfp.png
SCREENSHOT: http://i51.tinypic.com/2rmxsfp.png
<!DOCTYPE html>
<html>
<head>
<title>Fade bottom</title>
<style>
body{background:#FFF}
p {
color:#000;
margin:0 auto;
text-align:justify;
text-indent:30px;
width:600px;
}
#fadeBottom {
background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,0)),color-stop(1, rgba(255,255,255,0.7)));
bottom:0;
height:50px;
left:0;
position:fixed;
width:100%;
}
</style>
</head>
<body>
<p>Some long text here. Lorem ipsum?</p>
<div id="fadeBottom"></div>
</body>
</html>
推荐答案
无论您使用图片还是CSS3渐变'm afraid position:fixed
在iOS上无法使用。
Whether you use an image or a CSS3 gradient, I'm afraid position:fixed
doesn't work on iOS.
这篇关于使用CSS淡化UIWebView的底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!