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

文章来自:http://www.cnblogs.com/cocoajin/p/3523198.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3