ios webView代理

pragmamark - WebView 代理方法

pragmamark 开始加载

-(void)webViewDidStartLoad:(UIWebView *)webView{

//显示网络请求加载[UIApplication sharedApplication].networkActivityIndicatorVisible=true;}

pragmamark 加载完毕

-(void)webViewDidFinishLoad:(UIWebView *)webView{

//隐藏网络请求加载图标[UIApplication sharedApplication].networkActivityIndicatorVisible=false;//设置按钮状态[self setBarButtonStatus];

}

pragmamark 加载失败

-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{

NSLog(@"error detail:%@",error.localizedDescription);

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"系统提示"message:@"网络连接发生错误!"delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];

[alert show];

}

posted @ 2017-08-23 20:56  笑笑就好90  阅读(533)  评论(0编辑  收藏  举报