【发布时间】:2012-04-24 15:06:13
【问题描述】:
可能重复:
Change font size of UISegmentedControl
how to change the font size of UISegmentedControl text?
如何更改分段控件的文本大小?
谁能帮帮我!!
【问题讨论】:
标签: iphone objective-c ios xcode ipad
可能重复:
Change font size of UISegmentedControl
how to change the font size of UISegmentedControl text?
如何更改分段控件的文本大小?
谁能帮帮我!!
【问题讨论】:
标签: iphone objective-c ios xcode ipad
注意:这仅适用于iOS5+。
UIFont *font = [UIFont boldSystemFontOfSize:12.0f];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:font
forKey:UITextAttributeFont];
[segmentedControl setTitleTextAttributes:attributes
forState:UIControlStateNormal];
【讨论】:
UITextAttributeFont 在 iOS 7.0 中已弃用;改为使用 - NSDictionary *attributes = @{NSFontAttributeName: [UIFont boldSystemFontOfSize:12.0f]};