I have a iOS 9 screen with two UIWebviews on it; the two UIWebviews are set up the same in IB, and each displays an HTML table, with the same CSS. But the two views display differently: in the top one the table is scrolled down and shows a blank area at the top; the second one displays correctly.
The two HTML tables have a gray background to show their position here. Here's the view when it opens; there is a table in each of the outlined UIWebviews:
I can manually scroll the top view into the correct position:
I would, of course, like the top UIWebview to present the table at the top of the view.
Any ideas on why the top UIWebview scrolls the table down when it opens? I've seen this in several other instances and have not been able to figure out why or how to correct it.
Stonz2's link gave me the answer: add automaticallyAdjustsScrollViewInsets = false
to the viewController's viewDidLoad method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With