I am trying to create a view similar to what you see when reading an email in the Apple iOS Mail.app, where you can pinch anywhere in the view to zoom the UIWebView in and out, and the header at the top stays the same size.
Also, scrolling up/down should scroll the entire view, not just the UIWebView. Scrolling left and right only scrolls the UIWebView left/right, it does not affect the header.
I've already tried using a UITableView with the UIWebView as a view within a cell or as a header/footer view, but I could not the scrolling and zooming do not work correctly.
I am now trying to put a UIWebView within a UIScrollView and can't seem to get the scrolling to work correctly this way either, but it seems to be a better approach than putting the UIWebView in a UITableViewCell.
Here is a simple representation of the view hierarchy I am trying to create:
UIScrollView
-- UIView (this is the "header" view)
-- UIWebView
I am not sure if I need to disable scrolling/zooming on the UIWebView, or how to handle the scroll events for the container UIScrollView or the UIWebView internal scrollview.
Thanks in advance for any examples and advice! Please let me know if I left out any details.
self.webView.scrollView
– soulshined