我已经为我的UISegmentedControl设置了自定义字体,但似乎禁用了默认的autoAdjustFontSizeToFitWidth参数。
有没有办法保存它?非常感谢。
编辑:我想避免。
如果可能的话,每个片段都保持相同的宽度。
这里是我用来设置自定义字体的代码:
UISegmentedControl *segmentedControl = (UISegmentedControl *)subview;
UIFont *font = [UIFont fontWithName:DEFAULT_FONT size:DEFAULT_FONT_SIZE];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
[segmentedControl setTitleTextAttributes:attributes forState:UIControlStateNormal];
有没有办法保存它?非常感谢。
编辑:我想避免。
segmentedControl.apportionsSegmentWidthsByContent = YES;
如果可能的话,每个片段都保持相同的宽度。