I have a problem with my Galaxy Ace, it is locked in horizontal mode.
- From the Home page, drag the upper taskbar > tap on "Auto Rotate" to enable it.
- Press Menu, then Settings and then Display > Autorotate.
- Scroll to "Horizontal Calibration"
- Put your phone on a flat surface and then press Calibrate.