Handle multiple lists scroll in same view in swiftUI

Viewed 40

We have 2 Lists side by side in an HStack.

One of them interacts with the NavigationBar while the other does not!

How can we achieve the same behavior for all scrollables like lists?

Demo


Demo code
    NavigationView {
        HStack {
            List(1...100, id: \.self) { _ in
                RoundedRectangle(cornerRadius: 8).frame(width: 100, height: 50)
            }
            List(1...100, id: \.self) { _ in
                RoundedRectangle(cornerRadius: 8).frame(width: 100, height: 50)
            }
        }
        .navigationBarTitleDisplayMode(.inline)
        .navigationTitle("title")
    }

Note: All of them should interact with the bars preferably

0 Answers
Related