Skip to content

Instantly share code, notes, and snippets.

@HaifaCarina
Created December 1, 2012 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HaifaCarina/4184147 to your computer and use it in GitHub Desktop.
Save HaifaCarina/4184147 to your computer and use it in GitHub Desktop.
UIWebView implementation that loads content from from a local html file in the Xcode project.
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
webView.autoresizesSubviews = YES;
webView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
webView.dataDetectorTypes = UIDataDetectorTypeLink;
webView.backgroundColor = [UIColor redColor];
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"www"]];
[webView loadRequest:[NSURLRequest requestWithURL:url]];
[self.view addSubview:webView];
[webView release];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment