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.
精彩评论