
本文共 2714 字,大约阅读时间需要 9 分钟。
WKWebView���UIWebView���������Html���������������������������������
��������������������������������������������������������������������������� Html ��������������������������������������������������� WKWebView ������������ Html ��������������������������������������������������������������������������������������������������� UIWebView ������������ Html ���������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������
UIWebView������������Html���������������������������
������������ UIWebView ������������ Html ������������������������������������������������������������������������
UIWebView *view = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, BXScreenW, BXScreenH)];
- ������������������
NSBundle
��������� Html ��������������������������������������������������������������� Html ������������������������������������������������������������������������������ - ���������������������������
NSString
��������� Html ��������������������������������������������������������������������������������������������������������������������� - ��������������������������������������������������������������������������������������� GBK ������������������������������������������
- ������������������������������������������������������������������������������������ GB18030 ���������������������������������������������������
- ������������������������������������������������������������������������ UIWebView ���������������������������
- ������������������������ UIWebView ������������������������������������������������������
NSString *path = [[NSBundle mainBundle] pathForResource:@"������������" ofType:@"html"];NSURL *url = [NSURL fileURLWithPath:path];
NSStringEncoding * usedEncoding = nil;NSString *body = [NSString stringWithContentsOfURL:url usedEncoding:usedEncoding error:nil];
if (!body) { NSLog(@"GBK������"); body = [NSString stringWithContentsOfURL:url encoding:0x80000632 error:nil];}
if (!body) { NSLog(@"GBK18030������"); body = [NSString stringWithContentsOfURL:url encoding:0x80000631 error:nil];}
if (body) { [view loadHTMLString:body baseURL:nil];} else { NSLog(@"���������������������");}
[self.view addSubview:view];
���������������
��������� Html ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
