1
    import SwiftUI

struct FolderView: View {
    var body: some View {
        NavigationView{
            VStack{
                HStack{
                    Text("hi")
                }
                .frame(height : 50)
                .frame(maxWidth : .infinity)
                .background(.blue)
            
                
                List {
                    Text("hi")
                }
            }
            
            .navigationTitle("Task Folders 📁")
        }
    }
}

struct FolderView_Previews: PreviewProvider {
    static var previews: some View {
        FolderView()
    }
}

enter image description here

Hi! I tried to use Hstack container in NavigationView with List, But as you can see in my attached screenshot, it is working like that, I mean the container is mixed with navigationView Area.

Is there a some way that I can solve? How I can use that with List? Thank you!

1 Answer 1

1

Here is fixed variant - use as a background not a color but filled rectangle. Tested with Xcode 13.2 / iOS 15.2

demo

    HStack{
        Text("hi")
    }
    .frame(height : 50)
    .frame(maxWidth : .infinity)
    .background(Rectangle().fill(Color.blue))    // << here !!

Note: it is not clear for now whether that is a bug or a new NavigationView+background(color) feature.

Sign up to request clarification or add additional context in comments.

1 Comment

Asperi, Thank you so much!! I will try that right now! big help!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.