iOS webView的一些基本用法】的更多相关文章

1.自己拼接html来显示想要的文字(参考:http://www.mamicode.com/info-detail-492242.html) NSString *htmlStr=@"<html><head><title></title></head><body>暂无原文信息</body><html>"; [Web loadHTMLString:htmlStr baseURL:nil]; 效果…
贴代码: @interface UIWebView (JavaScriptAlert) -(void) webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(id)frame; - (BOOL)webView:(UIWebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)me…
ios webview清除缓存. ios默认webview是有缓存的,所以不改变URL的话,刷新不了网页数据,或者像我这样写 NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; if ([AFNetworkReachabilityManager sharedManager].reachable) { request.cachePolicy = NSURLRequestReloadIgnoringLoca…
https://www.cnblogs.com/dhui69/p/5596917.html iOS WebView 加载本地资源(图片,文件等) NSString *path = [[NSBundle mainBundle] pathForResource:@"关于.docx" ofType:nil]; NSURL *url = [NSURL fileURLWithPath:path]; NSLog(@"%@", [self mimeType:url]); //we…
iOS webView的加载时序 UIWebView加载顺序: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { NSLog(@"开始请求webview:%@",request.URL.relativeString); return YES; } -…
封装 MBProgressHud ==================================== #import "MBProgressHUD.h" @interface MBProgressHUD (Add) + (void)showError:(NSString *)error toView:(UIView *)view; + (MBProgressHUD *)showMessag:(NSString *)message toView:(UIView *)view; @e…
iOS WebView All In One WKWebView / UIWebView Swift Playground //: A UIKit based Playground for presenting user interface import PlaygroundSupport import UIKit import WebKit class ViewController: UIViewController, WKUIDelegate { var webView: WKWebView…
一.UIWebView 可以加载和显示某个URL的网页,也可以显示基于HTML的本地网页或部分网页: a. 加载 URL WebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 44, 320, 400)]; NSString *path = @"http://www.baidu.com"; NSURL *url = [NSURL URLWithString:path]; [WebView loadRequest:[NSURLR…
本文简单介绍下在IOS中,webView的基本用法,也顺便强化下自己的基础知识----天明少羽爬楼梯 一.加载外部HTML 显示webView 报错:NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) 或者 App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insec…
昨天,一个朋友让我帮他在IOS上弄这样一件事情: webView 调用远程URL,并且让远程的web 通过自定义标签能实现内嵌本地的图片.js 或音频等. 比如:在服务器端 的html文件中 这样写到 <html> <body> <h1>we are loading a custom protocl</h1> <b>image?</b><br/> <img src="myapp://image1.png&q…