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

ssacong

macrumors newbie
Original poster
Jun 9, 2008
10
0
Hi. I have a question regarding the view orientation. As title asks, is there anyway to make app to go back to portrait mode from landscape mode by coding? Here is my situation. I am in landscape view seeing stuff, and when I touch something I would like to show new view in a portrait view, not in landscape. like in Youtube app or movie player. after you done watching the video, the view just goes back to the portrait view.

it seem like when i load up the new view it just slides in landscape mode.
is there anyway to fix this? Appreciate any suggestions
 

fenrus110

macrumors regular
Mar 24, 2008
142
0
bumping this old thread, I would like to know too.

I have a couple Table Views in portrait, then when I go into the detail view, I want to be in Landscape. And when I leave Detail, I want to be in portrait for my Table Views.

and my Landscape detail isn't a graphic, it has like UILabels and UITextViews. I can't just make a landscape graphic and put it on.
 

fenrus110

macrumors regular
Mar 24, 2008
142
0
I think the YouTube and MoviePlayer go in Landscape because videos MUST play in landscape mode.

[[UIDevice currentDevice] setOrientation:(UIDeviceOrientation)]

You can call this and it works, but XCode gives a warning. I have no idea if it will pass Apple's review or if the function will even exist in later versions of the SDK.

[[UIApplication sharedApplication]setStatusBarOrientation(UIInterfaceOrientation)]

I also tried this, but it only moves the status bar, it doesn't transform the view to the specified orientation.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.