-1

Possible Duplicate:
Workaround for 'background-attachment: fixed' which is not working in iOS4

I have a problem, there is a way for fix the background on UIWebView with css? thank you

kikko088

Community
  • 1
  • 1
francesco.venica
  • 1,703
  • 2
  • 19
  • 54
  • What do you mean by fixing the background? A CSS background should already have a fixed non-draggable position... – sergio May 24 '11 at 18:14

1 Answers1

0

Not quite sure if this is the answer you're looking for, but you can inject javascript into a UIWebView page.

http://iphoneincubator.com/blog/windows-views/how-to-inject-javascript-functions-into-a-uiwebview

In theory you could just call document.write to write any html you need. If you have control over the html/css file, you could just add

<style type="text/css">
body  
{
background-image:url('smiley.gif');
background-repeat:no-repeat;
background-attachment:fixed;
}
</style>
Kendall Trego
  • 1,975
  • 13
  • 21
  • the problem is that "background-attachment:fixed;" not work...:( I can modify html/css! – francesco.venica May 24 '11 at 18:40
  • I have also tried using the css code suggested - the background still scrolls if you scroll the UIWebview (the desired effect is that the content scrolls over the top of the static image). The css seems valid - it just doesn't quite seem to work on the iPhone version of the browser - are there any workarounds? – Pete McPhearson Mar 22 '12 at 13:59