I want to set a picker button borderless and transparent in SwiftUI on macOS.
I tried using .background()
, .border()
and .opacity()
modifiers on the Picker view. However, I can't change the background to a transparent color using .background()
, I can't remove the border using .border()
, and I can't find a way to change only the background to transparent using .opacity()
.
Here is my code for the picker:
Picker(selection: .constant(1), label: EmptyView()) {
Text("1").tag(1)
Text("2").tag(2)
}
.scaledToFit()
.constant(1)
is a placeholder
Currently the picker looks like this:
I want it to look like the pickers in the Contacts app on Mac:
UPDATE (2019-11-30)
After trying all likely modifiers and functions that are applicable to a Picker
, I've determined that there is no solution so far. SwiftUI is incomplete as a replacement for storyboards or XIB as of now.