Hm. Landscape problem.

Discussion in 'iOS Development' started by Your Everyday Hacker, Jan 19, 2009.

  1. Your Everyday Hacker

    Your Everyday Hacker Banned

    Joined:
    Aug 12, 2008
    Messages:
    645
    Likes Received:
    0
    On my WIP app, when you press the button to go to the next view, it turns into the idea view [which is in landscape] but it turns out in portrait. Any ideas why?

    (BOOL)shouldAutorotateToInterfaceOrientation

    Please Register or Log in to view images


    UIInterfaceOrientation)InterfaceOrientation
    {
    return YES(interfaceOrientation ==
    UIInterfaceOrientationPortrait);
  2. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    You have the UIInterfaceOrientation set to portrait, i think?
    I can't really understand what your saying

    Please Register or Log in to view images

    .
  3. pooplie

    pooplie Banned

    Joined:
    Oct 27, 2008
    Messages:
    39
    Likes Received:
    0
    hey yeah i have this problem too
    i put:
    - (BOOL)shouldAutorotateToInterfaceOrientation

    Please Register or Log in to view images

    UIInterfaceOrientation)interfaceOrientation {
    return YES(interfaceOrientation == UIInterfaceOrientationPortrait);

    but i get a strange error..
    its really wierd
  4. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Not sure what you two are doing, or trying to do, but to get the device to support AutoRotation all you need is this:
    Code:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return YES;
    }
    
  5. pooplie

    pooplie Banned

    Joined:
    Oct 27, 2008
    Messages:
    39
    Likes Received:
    0
    hey thanks stephan it worked for me!
  6. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    No problem.

    Please Register or Log in to view images

    .

    StephEn*

    Please Register or Log in to view images

    .
  7. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    You have return yes infront of the portrait take the yes away and change the last word to landscape in the idea view class file
  8. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    Ugh, well one of you was missing "}" at the end of your function.

    And if you want to make it autorotate b4 it even launches in the info.plist

    UIInterfaceOrientation and for the var UIInterfaceOrientationPortrait
  9. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    I think he just didn't copy it all.
  10. Gi-lo(the real one)

    Gi-lo(the real one) New Member

    Joined:
    Dec 3, 2008
    Messages:
    19
    Likes Received:
    0
    Hey how to rotate(set orientation) something ( Icons,Dock) in Mobile Substrate?

Share This Page