Mobile Accessibility Guidelines - Design
Content resizing must
Users must be able to control font sizing and user interface (UI) scaling.
All users benefit when they can adapt the size of content to see and read it. This may be a constant or temporary adaption due, for example, to screen size, screen glare, or vision impairment.
Use a generous base font size that will be suitable for most users. Ensure content responds to platform native text resizing, and/or that scaling (or 鈥渮oom鈥) is supported.
Users who magnify or zoom in on content only see part of the screen. Try to keep on-screen changes close to the point of interaction. For example, if a user completes an input field incorrectly add a visual cue above, below or inside the field, rather than out to the side.
iOS
Users may zoom/enlarge content using the zoom feature within iOS, but this only permits users to zoom specific areas of a screen to be enlarged at any one time. To allow the user to resize an application鈥檚 text size, use for supported user interface components, such as UILabel
and UITextView
.
iOS Example (Objective-C)
UIFont *myHeaderText = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
UIFont *myBodyText = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
Android
Page zooming is handled natively through Android鈥檚 magnification gestures. However, this only allows for specific areas of the page to be zoomed at any one time. Hence, use relative text units (sp, or scale-independent pixels) to support Android鈥檚 built-in text resizing features.
Android Pass Example
<TextView
android:layout_width="match_parent";
android:layout_height="wrap_content";
android:textSize="20sp" />
HTML
Use relative units (ems) to specify font and container sizes. Take a responsive design approach, whereby the layout of the page will adapt depending on the size of a device鈥檚 screen.
Avoid applying maximum-scale=1.0
to the page鈥檚 meta
element, as this prevents a user from using the pinch-to-zoom gesture (although note that, from iOS10 onwards, a user will still be able to use pinch-to-zoom even if this attribute is applied). The correct approach is as follows:
<meta name=鈥漹iewport鈥 content=鈥漺idth=device-width, initial-scale=1.0鈥>
HTML Pass Example
Do not disable user scaling:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Resize content based on the viewport size:
@media only screen and (min-width: 32em) {
鈥
h1 {
font-size: 1.5em;
}
p {
font-size: 0.8em;
@media only screen and (min-width: 50em) {
鈥
h1 {
font-size: 2em;
}
p {
font-size: 1em;
Testing
Procedures
- Open the web page or activate the app.
- Verify that UI scaling (鈥渮oom鈥) is enabled.
- Verify that content can still be accessed when scaled up (鈥渮oom in鈥).
- Change the device default text size.
- Verify text resizes and properly reflows on the page/screen. Verify that scrolling is not disabled.
Outcome
The following checks are all true:
- It is possible to change the UI scale without losing access to content.
- The default text size is respected.
- Content properly reflows and scrolls as required when resized.