How to make iOS app orientation portrait only? - ios

How do I make my iOS app Portrait Only? It looks like it's already in portrait mode currently but when I flip my device it rotates still. I am using tableViews and collectionViews within my app, I'm not sure if they would affect these settings or not.

To fix this problem I had to add "Supported interface orientations (iPhone)" and set the item to "Portrait (bottom home button)" in my info.plist file

Related

Why iPhone sill rotate after I uncheck the device orientation (delete rotation from info.plist file)

I don't check any device orientation on the Deployment Info page, that is, there is no entry in the Supported interface orientations on the Info.plist. However, the iPhone still can rotate to landscape. How can I disable iPhone rotation? Do I need to write some code in the view controller? Thanks in advance.
When you don't check any orientation, it defaults to all of them. To keep the orientation at only portrait, you must check the portrait only orientation.
You can toggle here in the device orientation section which orientation that you want your app to support:
Just set it to portrait and you'll be fine.

Is there a way to start iOS app with the initial orientation dynamically?

I know that we can define main orientation in iOS apps. However I couldn't figure out a way to do what I want: If the device is in landscape mode, start the whole application in landscape mode. If not, start it in portrait.
Currently, if I start the application after rotating the device into landscape mode, It opens in portrait mode than it rotates. Is there a way to start the whole app in landscape? (Already rotated window)
Yes; just indicate that you support all device orientations in your info.plist. You can see this in Xcode in your project settings under "General" in Xcode 5.
Quote from Apple's UIViewController documentation:
Note: At launch time, apps should always set up their interface in a portrait orientation. After the application:didFinishLaunchingWithOptions: method returns, the app uses the view controller rotation mechanism described above to rotate the views to the appropriate orientation prior to showing the window.

Rotate MPMoviePlayerViewController while app is in Portrait mode

how can I autorotate MPMoviePlayerViewController according to the current mode, while the whole app is set to only portrait mode?
If your base SDK is iOS 6, you can't. The whole app (in the target summary pane = the info.plist) must be set to include all orientations that any part of your app will ever be willing to accept. You then filter out unwanted orientations from any parts of the app that should not be allowed to rotate to all of those orientations, e.g. with supportedInterfaceOrientations.

Rotating a view in objective-c

I am trying to make the multitasking switcher open in landscape mode all the time... even when the phone is being held in portrait... Any ideas? The class is "SBAppSwitcherController" and I'm calling the method "viewDidAppear"
Just set the Supported Interface Orientations to only landscape modes. To do that, you go to your project in the Project Navigator. Then, you will see the Supported Interface Orientations header. Click the dark icons referring to portrait mode to make them light. Then your program will only be in landscape mode. So, if I know what you are saying, you are done!

How to disable Tabris iOS client orientation?

Is there a way to disable Tabris iOS client orientation? Meaning, I would like to fix the application orientation not change it when device orientation change.
Currently there is no Tabris/Java API available ...yet - but it's planned.
To fix the App orientation, click on your Xcode App target, and select only the "Supported Device Orientations" (Options available there: Portrait, Upside Down, Landscape Left, Landscape Right)

Resources