Screen Orientation

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard

Support all users' preferred screen orientation

Not for use with personal data

WCAG 2.1 - 1.3.4 AA Impact - Serious

What We Check For

Your app should not restrict the user's preferred display orientation. For example, if a user has their device set to landscape mode, the app should rotate to match - not stay locked in portrait mode.

At a Glance

  • This rule has a serious impact for users
  • Do not lock your app to a single orientation
  • Remove any hard-coded orientation restrictions in your manifest or activity code

Impact to Users

Some people have a phone or tablet mounted in a fixed orientation. If the app cannot support that orientation, it becomes unusable for the user.

Confirm Screen Orientation Issue

  1. Rotate the device 90 degrees, from portrait mode to landscape mode
  2. One of the following will happen:
    • Inaccessible: The display will stay in portrait mode and not rotate to landscape mode.
    • Accessible: The display will rotate from portrait mode to landscape mode.

Fix Issues

Native Android

Allow your application to support any orientation by removing hard-coded orientation restrictions. Common places to check:

  1. In AndroidManifest.xml, remove or update the screenOrientation attribute on any <activity> element:
<!-- Remove or change this -->
android:screenOrientation="portrait"
  1. In activity code, remove any calls to setRequestedOrientation:
// Remove this
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

Flutter

Do not restrict the app to a single orientation using SystemChrome.setPreferredOrientations.

// Failing — locked to portrait only
SystemChrome.setPreferredOrientations([
  DeviceOrientation.portraitUp,                                                   
  DeviceOrientation.portraitDown,
]);                                                                               
                                                                                
// Passing — all orientations allowed
SystemChrome.setPreferredOrientations(DeviceOrientation.values);

Can I Ignore This Rule?

Screen Orientation has a Serious impact for users. We recommend remediating this issue in nearly all cases. If your app is specifically designed for a device that is physically constrained to one orientation (such as a point-of-sale terminal), ignoring this rule may be appropriate. Learn more about ignoring rules.

Resources