iPhone:UIWebview当向下滚动内容时,渐变背景启动 [英] iPhone:UIWebview Gradient background starts-over when scrolling down the content

查看:127
本文介绍了iPhone:UIWebview当向下滚动内容时,渐变背景启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将渐变背景应用于uiwebview自定义html内容时,它只适用于可见区域,当向下滚动内容时,渐变从顶部颜色值再次开始,任何想法?

When I apply the gradient background to uiwebview custom html content it only applies to visible area , when scroll down the content the gradient starts again from top color value again, any ideas?

[customHtml appendString:[NSString stringWithFormat:@"%@ ", @" <body style='background-color:#4b95bf; background-image:-webkit-gradient(linear, left top, left bottom, from(#55aaee), to(#003366));'>"]];


推荐答案

使用

 background-attachment:fixed;

这篇关于iPhone:UIWebview当向下滚动内容时,渐变背景启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆