I want to show a UIButton on a UIWebview. However the UIButton shows behind the webview.
i have tried the below code:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
if(navigationType==UIWebViewNavigationTypeLinkClicked && [[request.URL absoluteString] isEqualToString:myURL])
{
[_myBtn bringSubviewToFront:self.view];
[self.myWebView addSubview:_myBtn];
//i have tried this aswell
//[_myBtn bringSubviewToFront:self.myWebView];
//[self.view addSubview:_myBtn];
return NO;
}
return YES;
}
Any Ideas, what i am doing wrong ? Thanks
Comment out above code and Just move UIButton
below the UIWebView
in your Storyboard and then check.