IN WEBVIEW DISABLING UITOOLBAR'S BACK AND FORWARD BUTTTONS:

Jessica James

Total Post:16

Points:114
Posted by  Jessica James
 704  View(s)
Ratings:
Rate this:
I was creating a web browser using UIWebView control in iPhone, whenever I run the browser it successfully running but my problem is with its back and forward buttons that are always enable whether the page history available or not.
So I want to enable them when the page history available for back and forward buttons, in my app, I am using toolbar at the bottm side in Interface builder.
I am new in iPhone, so any one who know how to solve that problem help me...
  1. Tarun Kumar

    Post:214

    Points:1642
    Re: In WebView disabling UIToolBar's Back and Forward butttons:

    Here I provide you some code, these codes will execute whenever the user loads a page. But at first implement the UIWebViewDelegate and its method webViewDidFinishLoad:

    -(void)webViewDidFinishLoad:(UIWebView *)webView
    {
      // Enable or disable back
      [myBackButton setEnabled:[myWebView canGoBack]];
      // Enable or disable forward
      [myForwardButton setEnabled:[myWebView canGoForward]];
    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!