0
如何使用出现在UIWebView中的网页控制出现在UINavigationController中的标题?UINavigationController中的UIWebView
我想获得UINavigationController标题以反映网页的标题。
如何使用出现在UIWebView中的网页控制出现在UINavigationController中的标题?UINavigationController中的UIWebView
我想获得UINavigationController标题以反映网页的标题。
在你webViewDidFinishLoad方法,您需要调用类似
NSString * result = [myWebView stringByEvaluatingJavaScriptFromString:@"document.title"];
然后您将设置导航控制器标题:
self.navigationItem.title=result;
除非我失去的东西,从你的问题描述,这应该工作。