xcode 在 iPhone 中更改 UISegmentedControl 的文本大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10120699/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:57:29 来源:igfitidea点击:
Change Text Size of UISegmentedControl in iPhone
提问by Ahmad Sh-Qasem
Possible Duplicate:
Change font size of UISegmentedControl
how to change the font size of UISegmentedControl text?
可能的重复:
更改 UISegmentedControl
的字体大小如何更改 UISegmentedControl 文本的字体大小?
How i can change the text size of Segmented Control ?
如何更改分段控件的文本大小?
anyone can help me !!
任何人都可以帮助我!!
回答by Akshay
Note:This is only available for iOS5+.
注意:这仅适用于iOS5+。
UIFont *font = [UIFont boldSystemFontOfSize:12.0f];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:font
forKey:UITextAttributeFont];
[segmentedControl setTitleTextAttributes:attributes
forState:UIControlStateNormal];