Last active
December 22, 2015 05:29
-
-
Save prendio2/6424749 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (void)initialize | |
{ | |
//Unselected Background | |
[[UISegmentedControl appearance] setBackgroundImage:[UIImage imageNamed:@"UISegmentedControlBackgroundUnselected"] | |
forState:UIControlStateNormal | |
barMetrics:UIBarMetricsDefault]; | |
//Selected Background | |
[[UISegmentedControl appearance] setBackgroundImage:[UIImage imageNamed:@"UISegmentedControlBackgroundSelected"] | |
forState:UIControlStateSelected | |
barMetrics:UIBarMetricsDefault]; | |
//Highlighted Background | |
[[UISegmentedControl appearance] setBackgroundImage:[UIImage imageNamed:@"UISegmentedControlBackgroundHighlighted"] | |
forState:UIControlStateHighlighted | |
barMetrics:UIBarMetricsDefault]; | |
#warning dual state not working | |
//This is supposed to set background image for when a segment is both selected and highlighted | |
//so it doesn't revert to the highlighted state. Doesn't work however and when I tap on the | |
//selected item it takes the highlighted background from above. | |
[[UISegmentedControl appearance] setBackgroundImage:[UIImage imageNamed:@"UISegmentedControlBackgroundSelected"] | |
forState:(UIControlStateSelected|UIControlStateHighlighted) | |
barMetrics:UIBarMetricsDefault]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment