Home > DeveloperSection > Forums > In WebView disabling UIToolBar's Back and Forward butttons:
Jessica James
Jessica James

Total Post:16

Posted on    October-02-2015 11:51 PM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 650  View(s)
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...

Tarun Kumar

Total Post:214

Posted on    October-04-2015 11:24 PM

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]];

Don't want to miss updates? Please click the below button!

Follow MindStick