Search code examples
ios7tabbar

Strange top space with tab bar on iOS7


I have a tabBarController, each viewController of the tabBarController has a webview to load web pages.

When the app start, there's an unexpected white space on top of the webview, the space's size is approximately (screen width * status bar height), the screenshot like this: enter image description here

But if I click another tab, then go back to this tab, the white space is gone.

This bug is just in iOS7, Theres's no unexpected space in iOS8. And This bug just exists in device, simulator hasn't this bug.

Please give some advice how to fix this bug. Thank you very much.


Solution

  • Sounds like an issue with the webview's contentInsets. Try setting that manually in viewDidLayoutSubviews.