Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.4k views
in Technique[技术] by (71.8m points)

swift - SwiftUI & Mac Catalyst: Sidebar is not displayed correctly

I enabled Mac Catalyst for an iPad App and encountered an strange Display Problem of the Sidebar. Screenshot of the Mac Catalyst App Code:

@State private var selection: NavigationItem? = .start

NavigationView {
    List(selection: $selection) {
        NavigationLink(destination: StartView(), tag: NavigationItem.start, selection: $selection) {
                Label("Start", systemImage: "square.grid.2x2.fill")
                    .accessibility(label: Text("Start"))
            }
            .tag(NavigationItem.start)

        // 4 more Items
    }
    .listStyle(SidebarListStyle())
    .navigationBarTitle("Impfpass+")
        
    StartView()
}

Question: This Code produces a Standard Sidebar on the iPad, however, as you can see, the Mac Version is looking strange with this angular design. How can I achieve the Standard macOS Sidebar Design?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...