Before iOS 17 beta, the .pickerStyle(.segmented)
modifier makes the Picker
take up the entire available width in a toolbar. In iOS 17, it tightly fits the width of the text.
I can use .fixedSize()
modifier to make the segmented control tightly fit the content. In reverse, what is the recommended way to make it expand to fill the whole width?
In iOS 17 beta, I tried .frame(idealWidth: UIScreen.main.bounds.width)
and it works, but it doesn't have effect in iOS 16 and prior. Also, it is semantically wrong to set the ideal width to an arbitrary big value.
Example: