i am new to iphone. i want to disable Back(left arrow button) and Forward(right arrow button) button on UIToolBar in UIWebView. After moved web page want enable back button and then Forward button want to enable when its need. in my app, i am using toolbar at bottom side via interface builder. please any one help me!
Send the following message to the button object to enable/disable:
// Enable
[myButton setEnabled:YES];
// Disable
[myButton setEnabled:NO];
To determine whether you should show these buttons you should check the following properties on the webview:
[myWebView canGoBack];
[myWebView canGoForward];
You'll want to check these whenever the user loads a page. To do so implement the UIWebViewDelegate method webViewDidFinishLoad:
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
// Enable or disable back
[myBackButton setEnabled:[myWebView canGoBack]];
// Enable or disable forward
[myForwardButton setEnabled:[myWebView canGoForward]];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With