开发者

Is there a method somewhere supplied by Apple which will trigger when a UIWebView changes pages?

I am开发者_如何学Go trying to change the size of a webView when the website changes. What I need is to check the UIWebview's URL to see if it matches the one I am looking for. Or just changes at all.


If you implement the UIWebViewDelegate protocol in your view controller, you can handle the following message:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

and get the URL as a string:

NSString * urlString = request.URL.absoluteString;

Update

Make sure you set the delegate property on the UIWebView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜