加载html内容

阅读更多

html内容:

 


    
        
    
    
        

10 Reasons you should write something Each Day!!!

1. Remove stress from mind, place on paper.
2. Sweep Your Mind.
3. Keep Your Writing Skills Sharp.
4. Make Some Pocket Money.
5. Turn the Noise Off.
6. Enhance Your Communication Skills.
7. Know What You Want.
8. Develop Your Analytical Skills.
9. Get Away from Technology.
10. Meet Yourself All Over Again.

 

实现:

 

NSString *path = [[NSBundle mainBundle] pathForResource:@"WebView" ofType:@"html"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];	
NSString *htmlString = [[NSString alloc] initWithData: 
                        [readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];	
webView.opaque = NO; 
webView.backgroundColor = [UIColor clearColor];
[self.webView loadHTMLString:htmlString baseURL:nil];
[htmlString release];

 

示例图:

加载html内容_第1张图片

你可能感兴趣的:(iPhone,IOS,html)