Sunday, June 28, 2026
HomeiOS Developmentios - SwiftUI header background, which might ignore protected space

ios – SwiftUI header background, which might ignore protected space

[ad_1]

fellas programmers,
I’ve encountered an issue whereas attempting to study SwiftUI.
Is there any manner, and if there is- the right way to add background, which sticks to the highest and would ignore the highest protected space, to the “Physique weight” Part?
My code:

LazyVStack(alignment: .main, spacing:20, pinnedViews: .sectionHeaders) {
    
    Part(header:
                //Physique weight view
            Textual content("Physique weight")
        .font(.system(dimension: 28))
        .fontWeight(.medium)
    ){
        
        ForEach(0..<20) { index in
            Button(motion: {
                
            }, label: {
                WorkoutListItem(title:"title", progress: 0.7)
            })
        }
        
    }
}

What I’ve:
Image

Desired outcome:
Desired result

Since I am actually contemporary, on the subject of SwiftUI and complete Apple improvement, I’ve solely tried including rectangle as a background, which didnt assist

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments