I added html page on webview. I want to capture button action when I click the button. These are my javascript codes;
<div>
<input type="button" value="Hide Bottom Menu" onClick="hideBottomMenu(true)" />
</div>
<script language="javascript">
function hideBottomMenu(isHide){
Bridge.hideBottomMenu(isHide);
}
</script>
These are my objective-c codes;
I called html page on viewdidload, there is no problem to see html page.
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"bridge" ofType:@"html"];
NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
[_webView loadHTMLString:htmlString baseURL:nil];
UIWebView delegate methods;
-(void)webViewDidFinishLoad:(UIWebView *)webView{
[_webView stringByEvaluatingJavaScriptFromString:@"hideBottomMenu()"];
}
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
return YES;
}
When I click the button on webview, UIWebview delegate method (shouldStartLoadWithRequest) not calling.I want to capture button action from there.
Can anybody help me? Thank you, Halil.