How do I create a UISplitViewController in SwiftUI without grouped table style?

Dustin Pfannenstiel

TL;DR

SwiftUI's UISplitViewSplitView controller setup is grouping my table view. Why?

struct ContentView: View {
    var body: some View {
        NavigationView {
            List(0..<5) { value in
                HStack {
                    Text("Value \(value)")
                }
            }
            .navigationTitle("List View")

            Text("Split View")
        }
    }
}

Sample 1

A grouped iOS table view

Longer

I'm working through the SwiftUI track of WWDC20, treating it as a code-a-long. Beginning with the first video, "Introduction to SwiftUI".

I started a whole sample project with resources and everything. Everything goes swimmingly until I start working to support the iPad. I'm aware that there did end up being some changes since the videos were produced, but haven't found any relevant to the UISplitController.

After the bug presented itself I stood up a smaller project that just presented the split controller to test this issue.

So long as I'm just presenting the ContentView for iPhone, the UI works as expected.

struct ContentView: View {
    var body: some View {
        NavigationView {
            List(0..<5) { value in
                HStack {
                    Text("Value \(value)")
                }
            }
            .navigationTitle("List View")
        }
    }
}

Sample 2

An ungrouped iOS table view

I've tried executing on device and the problem persists.

Asperi

Just use plain list style explicitly:

var body: some View {
    NavigationView {
        List(0..<5) { value in
            HStack {
                Text("Value \(value)")
            }
        }
        .listStyle(PlainListStyle())       // << here !!
        .navigationTitle("List View")

        Text("Split View")
    }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to create XLSX table without any style?

How do I create a table without repeating the header?

How do you create a Preferences Style toolbar in SwiftUI for macOS?

How do I create a multiline Textfiled in SwiftUI?

How do I create a multiline TextField in SwiftUI?

How do I create an image button in SwiftUI

How do I create radio button grouped by labels on top

How do I create a grouped percent plot in R using ggplot?

How do I create error bars on a grouped bar plot in R?

How do I get segment style button in SwiftUI

How do I create a ViewPager without margins?

How do I create a page without a model?

How do I create a table in Tabulator without having to add the columns attribute?

SQL - How do I create a linkage table?

How do I create a dates table in Redshift?

How do I create a table with foreign keys?

How do I create a hash table in Java?

How do I create a dummy table in Quarto?

How do I create @OneToMany table in cassandra

How do I create a partitioned table in bigquery

How do i create a table using Jquery

How do I create this Table with html

How to create a table and style it in PHP

How do I create and store a matplotlib style file on macOS?

How do I create a Multi Line Text Field in SwiftUI for MacOS?

In SwiftUI, how do I create a dynamic rectangle for a bar chart?

How do I create a leading border for a view with cornerRadius in SwiftUI?

How do I create a View with a variable number of Subviews in SwiftUI?

How can I create a pivot table indexed on a column with duplicate entries that should be grouped by values of another column?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    pump.io port in URL

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

  14. 14

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  15. 15

    How to use merge windows unallocated space into Ubuntu using GParted?

  16. 16

    flutter: dropdown item programmatically unselect problem

  17. 17

    Pandas - check if dataframe has negative value in any column

  18. 18

    Nuget add packages gives access denied errors

  19. 19

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  20. 20

    Generate random UUIDv4 with Elm

  21. 21

    Client secret not provided in request error with Keycloak

HotTag

Archive