A short post for iOS people.
UIWebView
doesn’t (as of iOS 5.0) honor background-attachment: fixed;
in CSS, so if you need a fixed background image on a UIWebView
, you’re probably searching Google trying to find the answer.
Hopefully, this will help.
UIWebView *someWebView;
someWebView.opaque = NO;
someWebView.backgroundColor = [UIColor clearColor];
UIImageView *imageView;
imageView.image = [UIImage imageNamed:@”something”];
imageView.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
imageView.contentMode = UIViewContentModeScaleToFill;
imageView.frame = someWebView.bounds;
[someWebView insertSubview:imageView atIndex:0];
Leave a Reply