Table container, when scrolling content, the content will appear underneath and to the top of the column headings.

When the Table container is scrolled up the data rows just keep moving up and become unreadable with the column headings superimposed over the top.

Prior to scrolling upwards, the display will look like this.

However, if you start to scroll up

This behaviour does not seem to be the expected behaviour without any modifiers etc.

The following is the code I have been using.

import SwiftUI

struct Customer: Identifiable {
    let id = UUID()
    let name: String
    let email: String
    let creationDate: Date
}

struct SwiftyPlaceTable: View {
    @State var customers = [Customer(name: "John Smith",
                                     email: "john.smith@example.com",
                                     creationDate: Date() + 100),
                            Customer(name: "Jane Doe",
                                     email: "jane.doe@example.com",
                                     creationDate: Date() - 3000),
                            Customer(name: "Bob Johnson",
                                     email: "bob.johnson@example.com",
                                     creationDate: Date())]
    var body: some View {
        Table(customers) {
            TableColumn("name", value: \.name)
            TableColumn("email", value: \.email)
            TableColumn("joined at") { customer in
                Text(customer.creationDate, style: .date)
            }
        }
    }
}

#Preview {
    SwiftyPlaceTable()
}

Thank you for your post and providing a screenshot that illustrates the issue. Could you please specify the version of iOS and Xcode you are using? Additionally, do you have a focused sample project that I can utilize to reproduce the issue where the values appear beneath the labels?

If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Any chance you already filed a bug for this issue?

Thanks,

Albert Pascual
  Worldwide Developer Relations.

Thank you for your response.

I have submitted feedback FB20670375

The project is available at https://github.com/csantavy/TableContainer.git

Table container, when scrolling content, the content will appear underneath and to the top of the column headings.
 
 
Q