开发者

UIWebView in a UINavigationController

How can I control the title which appears in the UINavigationController with a web page which appears in a UIWebView?

I am trying to get the UINavigationController t开发者_如何学Citle to reflect the title of the web page.


In your webViewDidFinishLoad method, you'll need to call something like

NSString * result = [myWebView stringByEvaluatingJavaScriptFromString:@"document.title"];

Then you'll set up the navigation controller title:

self.navigationItem.title=result;

Unless I'm missing something from your problem description, this should work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜