Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://blogsiglo.com/archivo/1951.imagen-de-fondo-en-aplicacion-phonegap-ios-desde-internet-webview-apachecordova.html
- #pragma mark UIWebDelegate implementation
- - (void)webViewDidFinishLoad:(UIWebView*)theWebView
- {
- theWebView.opaque = NO; // @ToRo
- UIGraphicsBeginImageContext(self.view.frame.size);
- //estática
- //[[UIImage imageNamed:@"bgs.png"] drawInRect:self.view.bounds];
- //internet
- NSURL* url = [NSURL URLWithString:@"https://www.elsiglodetorreon.com.mx/new/bgs.png"];
- NSData* data = [NSData dataWithContentsOfURL:url];
- UIImage* img = [UIImage imageWithData:data];
- [img drawInRect:self.view.bounds];
- //fin internet
- UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- // Black base color for background matches the native apps
- theWebView.backgroundColor = [UIColor whiteColor];
- theWebView.backgroundColor = [UIColor colorWithPatternImage: image];
- return [super webViewDidFinishLoad:theWebView];
- }
- /* Comment out the block below to over-ride */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement