How can I stop iPhone screen rotation?
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.
To stop all apps from rotating when the device is turned around you can first install SBSettings on a jailbroken iPhone. There's an additional toggle available separately on Cydia that will lock the orientation of apps: Rotation Inhibitor.
After installing Rotation Inhibitor, you will have to activate the toggle. Swipe on your taskbar to open SBSettings and touch More -> Set Toggles. Turn on the Rotation toggle.
Now when you want to lock the orientation of apps in portrait mode just tap the Rotation toggle in SBSettings. To lock the orientation of apps in landscape mode, hold your finger on the Rotation toggle and it will cycle through the different orientation modes.
The mode you select will be the orientation apps will be locked to when rotation is disabled.