MAUIverse MAUIverse

Edge-to-Edge CollectionView Scrolling on iPhone Duo

On the iPhone Duo, the title bar scrolls out of the way without any special configuration, but a CollectionView doesn’t quite follow it to the screen edges. Pieter Nijs found small gaps at the top and bottom, and neither SafeAreaEdges option got rid of them: None left the first items hidden under the title, while Container kept them visible but left the gaps.

His approach is to separate the viewport from the content insets. The viewport should extend behind the system bars, and UIKit’s automatic inset adjustment should give the content a safe start and end. MAUI sets the native ContentInsetAdjustmentBehavior to Never, and switching it to Automatic wasn’t enough on its own. The collection view’s controller isn’t attached to the page’s controller, so UIKit never received the appearance notification it needs to calculate the safe area.

The reusable fix is an opt-in iOS handler in DuoExtensions.Maui, enabled with UseEdgeToEdgeCollectionView(). The post walks through what the handler does, the XAML setup using SafeAreaEdges="Container, None", and a few caveats. It applies to all iOS CollectionView controls in the app, and it can conflict with an existing custom handler. A standard ScrollView doesn’t need it.

If you’re adapting a list-heavy MAUI app for the foldable, the explanation of the safe-area plumbing is useful even if you don’t adopt the package.

View Source →

← Back to Community Feed

}