.NET MAUI

Edge-to-edge CollectionView scrolling on iPhone Duo with .NET MAUI

Pieter Nijs
.NET MAUI

Pieter Nijs explains why a .NET MAUI CollectionView on iPhone Duo either overlapped the title bar or left a few pixels of gap, and how MAUI's iOS handler fails to pass safe-area information to UIKit. The reusable fix ships as an opt-in custom handler in the DuoExtensions.Maui package.

Key points

  • Setting `SafeAreaEdges` to None pushes the list behind the title but leaves the first items hidden; Container avoids that yet keeps a few pixels of gap.
  • The catch is that the viewport should reach the system bars while content insets keep the first item in a safe position — two separate concerns.
  • MAUI sets the native CollectionView's `ContentInsetAdjustmentBehavior` to `Never`, and switching it to `Automatic` alone is not enough.
  • Because the handler never attaches the collection controller as a child of the page controller, UIKit misses the appearance notification and cannot compute insets.
  • `UseEdgeToEdgeCollectionView()` registers an iOS handler that allows layout behind opaque bars and sends a paired appearance transition when needed.
  • The package targets iOS CollectionViews only; pages with a plain ScrollView work with the right `SafeAreaEdges` and no custom handler.

Real-world use

  • iOS screens where the title bar scrolls away and the list must reach the top of the display
  • CollectionView pages that need their first item visible in a safe position on launch instead of hidden under the title
  • MAUI teams that do not want to hard-code title heights or update margins on every scroll event

This summary was generated by the agent from the original post on Pieter Nijs. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message