使用以下代码,我尝试更改UISegmentedControl的外观,但只有文本颜色随突出显示或选定的选项卡而变化 . 字体面和重量取自非活动属性,因此分段控件的所有部分都在 Headers 标签上显示Futura-Medium,无论是突出显示,选择还是正常 . 为什么是这样?

NSDictionary *attributesActive = [NSDictionary dictionaryWithObjectsAndKeys:
        [UIFont fontWithName:@"AmericanTypewriter-Bold" size:22.f], UITextAttributeFont,
        [UIColor redColor], UITextAttributeTextColor,
        [UIColor clearColor], UITextAttributeTextShadowColor,
        nil];
NSDictionary *attributesInactive = [NSDictionary dictionaryWithObjectsAndKeys:
        [UIFont fontWithName:@"Futura-Medium" size:16.f], UITextAttributeFont,
        [UIColor greenColor], UITextAttributeTextColor,
        [UIColor clearColor], UITextAttributeTextShadowColor,
        nil];

[segmentedControl setTitleTextAttributes:attributesActive forState:UIControlStateHighlighted];
[segmentedControl setTitleTextAttributes:attributesActive forState:UIControlStateSelected];
[segmentedControl setTitleTextAttributes:attributesInactive forState:UIControlStateNormal];