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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM