如何更改UISegmentedControl文本的字体大小? [英] How to change the font size of the text on a UISegmentedControl?
本文介绍了如何更改UISegmentedControl文本的字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是初始化我的 UISegmentedControl
的代码。
- (void)initializeToolButtons
{
NSArray * buttonTitles = [NSArray arrayWithObjects:@ANNEXET,@HOVET,@GLOBEN, ALL,无];
toolbuttons = [[UISegmentedControl alloc] initWithItems:buttonTitles];
toolbuttons.segmentedControlStyle = UISegmentedControlStyleBar;
toolbuttons.tintColor = [UIColor darkGrayColor];
toolbuttons.backgroundColor = [UIColor blackColor];
toolbuttons.frame = CGRectMake(0,0,320,30);
[toolbuttons addTarget:self action:@selector(toolButtonsAction)forControlEvents:UIControlEventValueChanged];
[self.view addSubview:toolbuttons];
$ b $ p
$ b 如何减少 UISegmentedControl
?
$ b em> toolButtons
已经被全局声明。 方案
这里你是
Following is the code for initializing my UISegmentedControl
.
- (void)initializeToolButtons
{
NSArray *buttonTitles = [NSArray arrayWithObjects:@"ANNEXET", @"HOVET", @"GLOBEN", "ALL", nil];
toolbuttons = [[UISegmentedControl alloc] initWithItems:buttonTitles];
toolbuttons.segmentedControlStyle = UISegmentedControlStyleBar;
toolbuttons.tintColor = [UIColor darkGrayColor];
toolbuttons.backgroundColor = [UIColor blackColor];
toolbuttons.frame = CGRectMake(0, 0, 320, 30);
[toolbuttons addTarget:self action:@selector(toolButtonsAction) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:toolbuttons];
}
How can I reduce the font size for each item on the UISegmentedControl
?
Note: toolButtons
has already been declared globally.
解决方案
Here you are
这篇关于如何更改UISegmentedControl文本的字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文