UISegmentedControl 修改字体大小 和 颜色

UISegmentedControl 修改字体大小 和 颜色

大小:

    UIFont *font = [UIFont boldSystemFontOfSize:14.0f];
    NSDictionary *attributes = [NSDictionary dictionaryWithObject:font
                                                           forKey:UITextAttributeFont];
    [sortListSeg setTitleTextAttributes:attributes
                                    forState:UIControlStateNormal];

颜色:

UIColor *greenColor = [UIColor greenColor];
    NSDictionary *colorAttr = [NSDictionary dictionaryWithObject:greenColor forKey:UITextAttributeTextColor];
    [sortListSeg setTitleTextAttributes:colorAttr forState:UIControlStateNormal];

参考:http://stackoverflow.com/questions/2280391/change-font-size-of-uisegmentedcontrol

   http://stackoverflow.com/questions/9029760/how-to-change-font-color-of-uisegmentedcontrol

原文地址:https://www.cnblogs.com/cocoajin/p/3523198.html