Post

Replies

Boosts

Views

Activity

Reply to In SwiftUI, How to increase Font Size/Style of a Picker?
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)   }
Mar ’22
Reply to How to increase font size of date picker?
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)   }
Mar ’22