iphone:UIWebview gradient background with CSS possible?
I want to give gradient to UIwebview's background which I load as:
[self.webView loadHTMLString:customHtml baseURL:nil];
but this html line does not give the effect, anyone knows how to do this better or can fix this css?
开发者_如何学Go [customHtml appendString:[NSString stringWithFormat:@"%@ ", @" <body style='background-color:#4b95bf; webkit-gradient(linear, left top, left bottom, from(#55aaee), to(#003366));'>"]];
The CSS is incorrect webkit-gradient()
is not a property, rather it -webkit-gradient()
is a value.
Rather the HTML should contain:
[customHtml appendString:[NSString stringWithFormat:@"%@ ", @" <body style='background-color:#4b95bf; background-image:-webkit-gradient(linear, left top, left bottom, from(#55aaee), to(#003366));'>"]];
Note the -
before the webkit-gradient
and the background-image:
精彩评论