Last active
February 15, 2024 12:43
-
-
Save cchana/237391b3fae189c08fb7a97630283645 to your computer and use it in GitHub Desktop.
How to place a borderless item into a list, removing all padding and spacing around the internal elements. In this example, I there's a groupbox which takes up the entire space of the list row. Question asked and answered on Stack Overflow: https://stackoverflow.com/questions/77982484/how-to-combine-groupbox-or-disclosuregroup-with-a-list-in-a-s…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| NavigationStack { | |
| List { | |
| Section { | |
| GroupBox("Box Title") { | |
| Text("Box Content") | |
| } | |
| } | |
| .listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) | |
| } | |
| } | |
| .navigationTitle("Page title") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment