.contentMargins(.top, 0, for: .scrollContent) has no effect on .plain List with section headers (iOS 17 & 18)

I'm trying to remove the extra top padding from the first section of a SwiftUI List using .plain style. I applied:

.contentMargins(.top, 0, for: .scrollContent)

But it seems to have no effect on iOS 17 and iOS 18.5 when section headers are present. However, it does work correctly on iOS 26 (tested with the latest Xcode beta).

Has anyone else run into this? Is this a known issue or regression in iOS 17/18? Is there any reliable workaround to remove or reduce the top padding in .plain list style when using section headers?

I have screenshots comparing iOS 18.5 and iOS 26 if needed.

Thanks in advance!

Could you try using insetGrouped for the list style. For example:

List {
    ...
}
.listStyle(.insetGrouped)
.contentMargins(.top, 0, for: .scrollContent)
.contentMargins(.top, 0, for: .scrollContent) has no effect on .plain List with section headers (iOS 17 & 18)
 
 
Q