Rounded corners in swiftui list sections

ios13swiftuiswiftui-list

Here is a screen shot of iOS 13 Health app – User profile. I recently started with and wondering how to develop a screen like below. I tried list styles plain and grouped. But I couldn't get the look of below layout.

Can UI like this develop purely using ?

I am specially looking for rounded sections and including a image inside the list.
iOS 13 Health Application - User profile

Best Answer

As of iOS 14, you can use the code below. It works just perfectly, just like in UIKit.

List {
    Section {
        Text("Item 1")
        Text("Item 2")
        Text("Item 3")
    }
    
    Section {
        Text("Item 4")
        Text("Item 5")
        Text("Item 6")
    }
}.listStyle(InsetGroupedListStyle()) // this has been renamed in iOS 14.*, as mentioned by @Elijah Yap
.environment(\.horizontalSizeClass, .regular)

Thank you.

Related Topic