1

Is it possible to have a custom UIView header that is part of the same scroll view as a UIWebView? if so, how could this be implemented?

Apurv
  • 17,116
  • 8
  • 51
  • 67
Halpo
  • 2,982
  • 3
  • 25
  • 54

2 Answers2

3

If you would need the headerView to move up and down with the webView (like in the mail app on iOS) but, of course, not change it's position when you zoom, it is a bit more complicated than that.

I ran into the same situation and so I put my solution on gitHub, in case someone else needs it :) Here's the project

Catalina T.
  • 3,456
  • 19
  • 29
1

Create a UIScrollView with the content size of your header + UIWebView.

When doing so, in the delegate of your UIWebView, catch when the web has finished loading and resize the UIWebView according to its content, and make its UIScrollView non-scrollable.

Halpo
  • 2,982
  • 3
  • 25
  • 54
Pablo A.
  • 2,042
  • 1
  • 17
  • 27