Is there a way to change the Font Size or Style inside a Picker?? In SwiftUI.
Thanks
I found this:
To change the attributes of a segmented picker, you can add this init to your View struct:
init() {
//This changes the "thumb" that selects between items
UISegmentedControl.appearance().selectedSegmentTintColor = .red
//This changes the color for the whole "bar" background
UISegmentedControl.appearance().backgroundColor = .purple
//This will change the font size
UISegmentedControl.appearance().setTitleTextAttributes([.font : UIFont.preferredFont(forTextStyle: .headline)], for: .highlighted)
UISegmentedControl.appearance().setTitleTextAttributes([.font : UIFont.preferredFont(forTextStyle: .largeTitle)], for: .normal)
//these lines change the text color for various states
UISegmentedControl.appearance().setTitleTextAttributes([.foregroundColor : UIColor.cyan], for: .highlighted)
UISegmentedControl.appearance().setTitleTextAttributes([.foregroundColor : UIColor.green], for: .selected)
}