---
title: "Draw edge to edge and pad content by the · Agent Wranglers"
url: https://agentwranglers.se/playbook/mobile-apps/updates-and-versions/edge-to-edge-insets
id: MOB-54
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 992
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Draw edge to edge and pad content by the system insets

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Updates and versions](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: MOB-54
- Level: Recommended
- Chapter: [Updates and versions](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions.md)
- Rule: Every screen draws behind the status and navigation bars and pads its controls by the system insets. No button, field or text sits under a system bar or a display cutout.
- Check: The manifest and themes contain no `windowOptOutEdgeToEdgeEnforcement`. Screenshot tests run on an Android 16 emulator in both navigation modes and on an iPhone with a notch. They find no tappable control inside the inset areas.
- Review by: 2027-08-31
- How: Apps that target Android 16, API level 36, can no longer opt out of edge-to-edge on Android 16 devices. The `windowOptOutEdgeToEdgeEnforcement` attribute is disabled for them. A layout that relied on the old bars then hides its bottom button under the gesture bar. On Android, read `WindowInsetsCompat` and apply the system bar and display cutout insets as padding. On iOS, lay out against the safe area, and only let backgrounds reach under the bars. Test with gesture navigation and with three-button navigation, since their insets differ. The target level comes from [build with the SDK the stores require](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions/store-sdk-deadlines.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Kotlin example

```kotlin
ViewCompat.setOnApplyWindowInsetsListener(checkoutBar) { view, insets ->
    val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
    view.updatePadding(left = bars.left, right = bars.right, bottom = bars.bottom)
    insets
}
```

### Plain text example

```swift
NSLayoutConstraint.activate([
    checkoutBar.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
    checkoutBar.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
    checkoutBar.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
])
```

## Sources

- [Android 16 behavior changes, edge-to-edge](https://developer.android.com/about/versions/16/behavior-changes-16)
- [Apple, Positioning content relative to the safe area](https://developer.apple.com/documentation/uikit/positioning-content-relative-to-the-safe-area)

## Related rules

- MOB-15 [Build with the SDK the stores require](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions/store-sdk-deadlines.md) in Mobile apps
- MOB-56 [Lay out every screen for tablets and foldables in both orientations](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions/large-screen-layouts.md) in Mobile apps

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/mobile-apps/updates-and-versions/edge-to-edge-insets">Agent Wranglers mobile apps playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Build native code for 16 KB memory pages](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions/android-16kb-pages.md)
- Next: [Handle the back gesture with the predictive back callbacks](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions/predictive-back.md)
- [Updates and versions](https://agentwranglers.se/playbook/mobile-apps/updates-and-versions.md)
