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://*.com/questions/2280391/change-font-size-of-uisegmentedcontrol

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

UISegmentedControl 修改字体大小 和 颜色

上一篇:project之chrome.exe


下一篇:ios 一个正则表达式测试(只可输入中文、字母和数字)