Created
April 2, 2014 04:15
-
-
Save grevolution/9927836 to your computer and use it in GitHub Desktop.
UIProgressView setTrackImage and setProgressImage broke on iOS 7.1, If you are using simple flat color image for your UIProgressView, you can do this:
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
| #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
| #define IS_OR_GREATER_IOS7 SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0") | |
| if(IS_OR_GREATER_IOS7) { | |
| //specify your track color here | |
| [[UIProgressView appearance] setTrackTintColor:[UIcolor redColor]]; | |
| //specify your progress track color here. | |
| [[UIProgressView appearance] setProgressTintColor:COLOR_2D2D2D]; | |
| } else { | |
| //keep your old logic here. | |
| [[UIProgressView appearance] setTrackImage:[UIImage imageNamed:@"img_timeline"]]; | |
| [[UIProgressView appearance] setProgressImage:[UIImage imageNamed:@"img_timeline_highlight"]]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment