Closed chika-kasymov closed 8 years ago
I add header to UIWebView as subview and constraints to make the trick, so that header not overlays UIWebView content.
UIWebView
Sample code:
[self.webView.scrollView addSubview:self.newsPagerView]; [self.newsPagerView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:-headerHeight; [self.newsPagerView autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.webView]; [self.newsPagerView autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:self.webView]; self.webView.scrollView.contentInset = UIEdgeInsetsMake(headerHeight, 0, 0, 0);
Code works great, but when I added TLYShyNavBar self.shyNavBarManager.scrollView = self.webView.scrollView;, UIWebView's UIScrollView's contentInset not works. contentInset has right value, but visually placed wrong.
self.shyNavBarManager.scrollView = self.webView.scrollView;
UIScrollView
contentInset
I will use another approach to implement header.
I add header to
UIWebView
as subview and constraints to make the trick, so that header not overlaysUIWebView
content.Sample code:
Code works great, but when I added TLYShyNavBar
self.shyNavBarManager.scrollView = self.webView.scrollView;
,UIWebView
'sUIScrollView
'scontentInset
not works.contentInset
has right value, but visually placed wrong.