UIWebView autorotate

Discussion in 'iPhone/iPad Programming' started by XcodeNewb, Feb 19, 2009.

  1. macrumors member

    Joined:
    Feb 6, 2009
    #1
    I am trying to rotate a uiwebview to landscape mode. I have a toolbar at the top of the screen and a uiwebview on the rest of the screen. I added this code:

    Code:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return ((interfaceOrientation == UIInterfaceOrientationPortrait) ||
    	        (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
    	        (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
    	
    }
    
    but the view will not rotate. I am sure I am missing something but cannot figure it out. Do I have to set the webview and toolbar up in IB to autorotate?

    Any help is appreciated.

    Thanks
     
  2. thread starter macrumors member

    Joined:
    Feb 6, 2009
    #2
    The view now rotates but it is like looking at a portrait view in a landscape mode. I cannot get the webview or toolbar to stretch to the sides. I have tried setting this up in IB. Is there anything else I need to do?

    Which properties in IB need to be set?

    Thanks
     
  3. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    Probably the Autosizing ones in the Size Inspector.
     
  4. thread starter macrumors member

    Joined:
    Feb 6, 2009
    #4
    Dont Work :(
     
  5. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    How did you manage to get it rotating?
     

Share This Page