Change font for selected segment in uisegmentedcontrol

I notice that on one of my segmented controls it is difficult to determine which segment is selected. I thought I could highlight the font, or slightly increase the font size. I am trying to do this, but it does not work:

UIFont *boldFont = [UIFont boldSystemFontOfSize:16.0];
    NSDictionary *fontDict = [[NSDictionary alloc] initWithObjectsAndKeys:boldFont, UITextAttributeFont, nil];
    [_tableSegmentedControl setTitleTextAttributes:fontDict forState:UIControlStateSelected];

My text looks the same in both segments of the control segment. Do I need to do something like this? Change textColor to UISegmentedcontrol

I was hoping for a lighter approach in iOS 5 with add-ons if possible. Thank.

+3
source share
1 answer

I'm not sure, but I think [UIFont boldSystemFontOfSize: 16.0f]; f is absent. try it and tell me

NSlog , ,

else

NSDictionary * attributes = [ NSDictionaryWithObject:                                                      forKey: UITextAttributeFont]; , . , .

+2

All Articles