قالب وردپرس درنا توس
Home / IOS Development / ios – Add Header View to WKWebView ScrollView

ios – Add Header View to WKWebView ScrollView



I webView Delegate methods

  - (void) webViewDidFinishLoad: (UIWebView *) webView

add the following code base [main page] mainWebViewObj.scrollView.backgroundColor = [UIColor whiteColor];

if (! [headerView superview])
{
[webView.scrollView addSubview:headerView];
[webView.scrollView bringSubviewToFront:headerView];
}
[mainWebViewObj.scrollView setContentOffset:
CGPointMake(0, -mainWebViewObj.scrollView.contentInset.top) animated:NO];

this worked perfectly for me. Hope it will solve your problem.


Source link