문제

Hi I have looked everywhere but nothing as help, I am trying to send the UIWebView page Title to UINavigationBar.

I would also like it if a user clicks on a link the UINavigationBar shows a back button but if on the home page hide the back button.

If you can help that would be very nice

도움이 되었습니까?

해결책

to retrieve the title page into an UIWebView you can use it:

myNavigationBar.title = [myWebView stringByEvaluatingJavaScriptFromString:@"document.title"];

If you want to go back you can do that:

if ([myWebView canGoBack]){
    [myWebView goBack];
}

To know if the user has loaded a new page you must set the UIWebViewDelegate. For more information see the UIWebView Class Reference and the UIWebViewDelegate Protocol Reference

다른 팁

As of iOS8 you should just use WKWebView and its title property.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top