Search code examples
iphoneiosuiwebviewwebview

UIWebView pushed up under statusbar on launch


I am trying to build an application with a UIWebView for the iPhone.

This was working great, until in turned on rotation support in my app. Now the webview is pushed up under the status bar, when I launch the app. When I rotate it to landscape, and back to portrait, the webview is suddenly back to the wanted position.

I have included an image of what happens below.

What could possibly cause this? Should i change some settings for the webview or what could it be?

If you need anymore information, please let me know.

Screenshot: a busy cat
(source: teet.dk)

//Jens


Solution

  • Instead of doing

    [window addSubview:[wvTutorial view]];
    

    Try doing:

    [window.view addSubview:[wvTutorial view]];
    

    Also make sure your XIB view doesn't have a status bar.


    EDIT

    What about

    self.window.rootViewController = [[WebViewController alloc] initWithNibName:@"WebView2" bundle:[NSBundle mainBundle]];