Can anyone please tell me how can I change the font type and size of UISegmentedControl
?
Ios – Change font size of UISegmentedControl
cocoa-touchfont-sizeiosiphoneuisegmentedcontrol
Related Topic
- Ios – Set UIButton title UILabel font size programmatically
- Change font size macvim
- Python – How to change the font size on a matplotlib plot
- Java – How to change font size in Eclipse for Java text editors
- Css – Responsive font size in CSS
- Css – Font scaling based on width of container
- Ios – How to change Status Bar text color in iOS
- Swift – how to change font size and font name of uisegmentedcontrol programmatically on swift
Best Answer
I ran into the same issue. This code sets the font size for the entire segmented control. Something similar might work for setting the font type. Note that this is only available for iOS5+
Obj C:
EDIT:
UITextAttributeFont
has been deprecated - useNSFontAttributeName
instead.EDIT #2: For Swift 4
NSFontAttributeName
has been changed toNSAttributedStringKey.font
.Swift 5:
Swift 4:
Swift 3:
Swift 2.2:
Thanks to the Swift implementations from @audrey-gordeev