Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Muthu.chidambar

macrumors newbie
Original poster
May 20, 2009
14
0
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]
 
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]

you need to set the following function...

- (BOOL) shouldAutorotateToInterfaceOrientation:.

UIInterfaceOrientationPortrait etc...
 
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.
 
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.
 
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.
 

Attachments

  • ORIENTATION 3.zip
    27.6 KB · Views: 81
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.
 

Attachments

  • ORIENTATION.zip
    28.4 KB · Views: 86
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.
 
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.

what was the original issue that you just resolved ?

i will take a look at the second source code here in a bit.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.