UIWebview 加载出错 以及 加载本地html文件

来源:互联网 发布:js string startswith 编辑:程序博客网 时间:2024/06/05 09:53


控制台打印:Application Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.




UIWebView加载本地html文件

UIWebView*webView_=[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320,400)];

    webView_.delegate=self;

    [self.viewaddSubview:webView_];

    

    NSString *filePath =[[NSBundle mainBundle]pathForResource:@"创业企业_详情"ofType:@"html"];

    NSString *htmlString =[NSString stringWithContentsOfFile:filePathencoding:NSUTF8StringEncoding error:nil];

    [webView_loadHTMLString:htmlString baseURL:[NSURLURLWithString:filePath]];




0 0
原创粉丝点击