Created
December 1, 2012 19:04
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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