orientation in iphone 3.0

Discussion in 'iOS Programming' started by Muthu.chidambar, May 20, 2009.

  1. Muthu.chidambar macrumors newbie

    Joined:
    May 20, 2009
    #1
    In iphone 3.0, the photo, navigation bar, toolbar and also the status bar rotates when the orientation is changed in the photos App..... When the user clicks the back button in the navigation bar the gallery view of the photos is displayed in portrait mode... I am not able to achieve this effect... can anyone tell is it possible to do that.?????
    It should be possible ....

    Basically I need to load or allow rotation only to selected vies in landscape mode.... Those views which dosent support rotation should load in portrait mode.

    P.S. [Without using custom back buttons in UINavigation bar]
     
  2. FarSeide macrumors 6502a

    FarSeide

    Joined:
    Feb 17, 2008
    Location:
    Earth Lane
    #2
    you need to set the following function...

    - (BOOL) shouldAutorotateToInterfaceOrientation:.

    UIInterfaceOrientationPortrait etc...
     
  3. Muthu.chidambar thread starter macrumors newbie

    Joined:
    May 20, 2009
    #3
    Thanks for the reply..


    That works fine. But when i load the view controller(which supports landscape mode) again and click back in the navigation bar, it gives an abnormal transition .

    Instead of the normal pop, the view flips to landscape for a second and the same effect which occured last time is done.
     
  4. FarSeide macrumors 6502a

    FarSeide

    Joined:
    Feb 17, 2008
    Location:
    Earth Lane
    #4
    I'm assuming your using multi view to perform this since your going back and forth between views.

    when you set you set your view controller, are you bumping up the retain count ? perhaps it's being deallocated or released.

    Just trying to help out. Its hard to determine the cause without actually looking at the source.
     
  5. Muthu.chidambar thread starter macrumors newbie

    Joined:
    May 20, 2009
    #5
    I have attached the sample code for the scenario which i am facing. If you are able to download the sample which is attached, you can see that the first viw will not rotate at any condition (independent of the orientation it remains in portrait).

    The second view can be loaded if u click on next in the first view. this view can be rotated to landscape orientations. If the back button in navigation bar is clicked . The first view loads in portrait.

    No issues till now.

    But, now if you again load the second view by clicking on next in first view and try to come back to the first view without changing the orientation. Am getting an abnormal effect. As far as i could guess, the view is turning to landscape for a second and again popping the view out.

    Can anyone tell how to avoid this animation and get the normal pop animation.
     

    Attached Files:

  6. Muthu.chidambar thread starter macrumors newbie

    Joined:
    May 20, 2009
    #6
    I found the answer for this. But still there is an issue in this.

    Load Second View. ---- turn to landscape ---- pop out by clicking back button in navigation bar --- again load second view(come back ,,, this is what i was searching for, now it works)--- now again load the second view and try to change orientation, it wont turn to landscape for the first time.

    have attached the sample code.
     

    Attached Files:

  7. FarSeide macrumors 6502a

    FarSeide

    Joined:
    Feb 17, 2008
    Location:
    Earth Lane
    #7
    are you using 3.0 or 2.x. Not that it matters but its not rotating the screen orientation at all.

    I will take a look and try to help out.
     
  8. FarSeide macrumors 6502a

    FarSeide

    Joined:
    Feb 17, 2008
    Location:
    Earth Lane
    #8
    what was the original issue that you just resolved ?

    i will take a look at the second source code here in a bit.
     
  9. Muthu.chidambar thread starter macrumors newbie

    Joined:
    May 20, 2009
    #9
    Am using 3.0.... Actually in the device it turns.... I checked it....
     

Share This Page