Connect & Get help from fellow developers on our Discord community.
Ask the Community
App and screen orientation lock
Locking your app’s orientation, whether at the app level or screen level, can significantly impact accessibility. An app that restricts content to either portrait or landscape mode limits user flexibility and can hinder the experience for those who need to use the app in a different orientation due to physical or situational constraints.
- Rule Category :
Display Orientation
- WCAG 2.1 & 2.2 SC :
1.3.4 (AA)
- Rule Severity :
Serious
- Supported Platforms :
Android
,iOS
Success criteria
The rule checks for the following violations:
- Content within the application is restricted to only one orientation, either portrait or landscape.
- Activities or view controllers in the app are set to a fixed orientation.
How to fix
-
Review the application configuration: Open
AndroidManifest.xml
and verify that no activity is locked to a specific orientation. Activities should allow the switch between portrait and landscape modes. -
Update activity settings: If an activity is locked to a specific orientation, remove or adjust the
screenOrientation
setting so activities support both portrait and landscape modes.
-
Review application settings: In the app’s
.plist
file, confirm that both portrait and landscape orientations are listed under supported interface orientations. - Update view controller behavior: In the app code, make sure view controllers aren’t locked to a specific orientation and can rotate based on the device orientation.
Example
The following example scan report highlights that the app is restricted to a single orientation.
Error
- The application is locked to a single orientation, either portrait or landscape. This restriction makes the content inaccessible in the other orientation, potentially affecting users who require a specific orientation.
Fix
- Review the
AndroidManifest.xml
file and check thescreenOrientation
attribute of all the activities that are locked to a specific orientation. Ensure the activities are configured to support both portrait and landscape modes.
- Review the app’s
.plist
file to ensure both orientations are supported. - Review the app’s view controllers to ensure they are not locked to a specific orientation.
References
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!