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