I am trying to get a webpage with a fixed background image, so the image does not move when the page scrolls in UIWebView.
I found the following: background-attachment: fixeddoes not work in iOS4 (using 4.2.1). To perform a double check, I prepared a page with a code snippet (below) inside the section <head>, and the page works as expected in Safari and Firefox on Mac, but iPhone Safari fails to do this ...
What do you propose as a workaround to achieve the expected results? I made my UIWebView translucent and added a UIImageView, so I see a “fixed background image” through a translucent page. Unfortunately, I see the borders of the UIWebView when I look at its end / start edges.
Is there any official Apple resource / webpage that says it’s background-attachment: fixednot implemented for iOS4?
Hooray!
PS The above code snippet:
<style type="text/css">
body {
background: #ffffff url('image.jpg') fixed no-repeat;
background-attachment: fixed;
}
</style>
source
share