UIWebview content not at the top of the screen

I have an iOS 9 screen with two UIWebviews on it; two UIWebviews are configured the same in IB, and each displays an HTML table with the same CSS. But two views are displayed differently: at the top, the table scrolls down and shows an empty area at the top; the second is displayed correctly.

Two HTML tables have a gray background to show their position here. Here is the view when it opens; There is a table in each of the outlined UIWebviews:

I can manually scroll the top view to the correct position:

Screenshot two

Of course, I would 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 saw this in several other cases and could not understand why and how to fix it.

+6
source share
1 answer

The Stonz2 link gave me the answer: add automaticallyAdjustsScrollViewInsets = false to the viewController viewDidLoad method.

+8
source

All Articles