您的位置:首页 > Web前端 > HTML5

Xcode运行HTML5代码

2016-07-13 10:07 369 查看
@property(nonatomic,strong)UIWebView *webView;

self.webView = [[UIWebView alloc]init];
_webView.frame = self.view.bounds;
self.webView.delegate = self;
[self.view addSubview:_webView];

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSString *fileContent = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
[self.webView loadHTMLString:fileContent baseURL:[NSURL URLWithString:filePath]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: