Reputation: 247
I would like to decrease the width of a List and also round its corner.
I have tried the .cornerRadius() and frame(width:) modifiers, but it did not work for me.
Upvotes: 1
Views: 1152
Reputation: 100543
You can try
struct ContentView : View {
var body: some View {
List{
Text("Hello World").listRowBackground(Color.green)
Text("Hello World").listRowBackground(Color.green)
Text("Hello World").listRowBackground(Color.green)
Text("Hello World").listRowBackground(Color.green)
}.cornerRadius(30).frame(width: 200, height:200, alignment: .center)
}
}
Upvotes: 2