Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you disable rotation globally in an iOS app?

Tags:

xcode

ios

I have an app made up of a lot of view controllers... in the project summary I've set Portrait orientation as the only supported device orientation.

However, the app still gets messed up when turned sideways.

My question is, is there a way to globally disable autorotation through app delegate or something?

Or do I have to go into all of my view controllers and add the "shouldAutorotateToInterfaceOrientation" method?

Just don't want to miss adding it to one or something...

Thanks!

like image 562
sayguh Avatar asked Apr 12 '12 13:04

sayguh


People also ask

How do you stop iPhone apps from rotating?

Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off.

How do I restrict landscape mode in IOS?

If you want to disable landscape orientation for both iPhone and iPad. Go to Targets and Go to the General tab. See the below screen and deselect landscape left and landscape right.

Can you force apps to rotate on iPhone?

Check Rotation Lock On an iPhone with a Home button, swipe up from the bottom of the screen to access it. On an iPhone without a Home button, swipe down from the top-right corner of the screen instead. Here, tap on the rotation lock icon (which looks like a lock with a circular arrow) to turn it on or off.


1 Answers

In Info.plist expand "Supported interface orientations" and remove Landscape items to make your application only run in portrait mode.

like image 69
Supahfly Avatar answered Sep 19 '22 09:09

Supahfly