In a UISegmentedControl change their style is applied with another away from iOS 5.0
Declare one NSDictionary: attributes
Later to first insert your own style with object: [UIFont fontWithName: @ “Eraser” size: 12] and after the attribute to apply the object just written, in this case, UITextAttributeFont, the font.
Complete with highlightedAttributes:
1 2 3 4 5 6 7 8 |
NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: [UIFont fontWithName:@"Eraser" size:12], UITextAttributeFont, [UIColor grayColor], UITextAttributeTextColor, nil]; [sgt_week setTitleTextAttributes:attributes forState:UIControlStateNormal]; NSDictionary *highlightedAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:UITextAttributeTextColor]; [sgt_week setTitleTextAttributes:highlightedAttributes forState:UIControlStateHighlighted]; |
This is the result: