BLACK FRIDAY: Save 50% on all my books and bundles! >>

How to adjust the scroll edge effect for ScrollView and List

Paul Hudson    @twostraws   

Updated for Xcode 16.4

New in iOS 26

SwiftUI’s scrolling views – that's ScrollView, List, and Form – automatically have a scroll edge effect applied in iOS 26 and later. This causes your content to be blurred and dimmed so that it works better next to surrounding UI controls such as the status bar or a tab bar.

If you prefer, you can selectively disable the scroll edge effect for any scrolling view by using the scrollEdgeEffectStyle() modifier, giving it the .hard style for any edges you want.

For example, this applies the hard edge effect along the top of the List, causing it to cut off sharply rather than blur and dim:

NavigationStack {
    List(1..<101) { i in
        Text("Row \(i)")
    }
    .scrollEdgeEffectStyle(.hard, for: .top)
}

Download this as an Xcode project

This is helpful when you have custom UI on one side of your screen, where you don't want the scrolling content to move under it – if you have lots of buttons or other custom views up there, you might prefer a hard edge to avoid creating clutter.

For example, this places a custom label in the navigation title space, and applies a hard scroll edge effect so the list doesn't underlap the toolbar label:

NavigationStack {
    List(1..<101) { i in
        Text("Row \(i)")
    }
    .scrollEdgeEffectStyle(.hard, for: .top)
    .toolbar {
        ToolbarItem(placement: .title) {
            Label("My Awesome App", systemImage: "sparkles")
                .labelStyle(.titleAndIcon)
        }
    }
}

Download this as an Xcode project

Note: If you just want the scroll effect to disabled, use scrollEdgeEffectDisabled() with no parameters, or alternatively provide it with specific edges to disable.

Save 50% in my Black Friday sale.

SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further for less! Get my all-new book Everything but the Code to make more money with apps, get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn Swift Testing, design patterns, and more.

Save 50% on all our books and bundles!

Similar solutions…

BUY OUR BOOKS
Buy Everything but the Code Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Interview Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Average rating: 5.0/5

 
Unknown user

You are not logged in

Log in or create account