How do I make this just make the picker visible?

Good day, how do I just make the picker visible and not have the lists section background visible like in the settings app?

The code:

import SwiftUI



struct ContentView: View {

    @State private var on: Bool = false

    var body: some View {

        List{

            Picker("OK", selection: $on) { 

                Text("A")

                Text("B")

            }

            .pickerStyle(.segmented)

        }

    }

}

The Settings app picker:

Thank You.

Answered by BabyJ in 729568022

You can just remove the background colour for the list row, like this:

Picker(...) {
    ...
}
.pickerStyle(.segmented)
.listRowBackground(Color.clear)
.listRowInsets(.init()) // optional
Accepted Answer

You can just remove the background colour for the list row, like this:

Picker(...) {
    ...
}
.pickerStyle(.segmented)
.listRowBackground(Color.clear)
.listRowInsets(.init()) // optional
How do I make this just make the picker visible?
 
 
Q