If you're seeing an icon of a padlock surrounded by an arrow in your iPhone's icon bar, it means that your iPhone has rotation lock enabled.
Rotation lock allows your iPhone to be locked or "frozen" in portrait mode. In other words, turning your iPhone horizontal won't cause the screen to rotate into landscape mode.
If you've ended up in rotation lock accidentally, and want to know how to interact with the iPhone's rotation lock feature, visit our FAQ entitled "How do I lock rotation in iOS?".
In iOS 8 and iOS 7, iPhone rotation locking has been moved to the Control Center. To enable rotation lock and prevent the screen from automatically changing orientation when the iPhone is turned:
To access Control Center and lock rotation in iOS 7/8 follow these steps:
1. Swipe up from the bottom of the home screen to bring up Control Center.
2. The top row of the Control Center shows 5 circular toggles.
UPDATE: iOS 4 features a built-in rotation lock function. Find out more information about how to use rotation lock here.
Some iPhone applications have preferences to set an accelerometer lock under Settings. When rotation is disabled, the orientation of the app stays fixed in one direction no matter which way the iPhone is turned.
Most commonly used apps such as Safari, Messaging, Mail and iPod do not have this feature available in the preferences. In contrast, orientation can be temporarily fixed when viewing photos on the iPhone Camera Roll or Photo Library.
Some iPhone applications have preferences to set an accelerometer lock, which keeps the orientation of the app in one direction no matter which way the iPhone turns. Unfortunately, most commonly used apps do not have this feature.
Rotation can be switched off when viewing photos on the iPhone Camera Roll or Photo Library. When viewing a photo, hold down with one finger on the photo as if you're trying to copy the image.