forked from Grouper/FlatUIKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIProgressView+FlatUI.m
40 lines (30 loc) · 1.26 KB
/
UIProgressView+FlatUI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// UIProgressView+FlatUI.h
// FlatUITestProj
//
// Created by Alex Medearis on 5/16/13.
// Copyright (c) 2013 Alex Medearis. All rights reserved.
//
#import "UIImage+FlatUI.h"
@implementation UIProgressView (FlatUI)
- (void)configureFlatProgressViewWithTrackColor:(UIColor *)trackColor {
UIImage *trackImage = [UIImage imageWithColor:trackColor cornerRadius:4.0];
trackImage = [trackImage imageWithMinimumSize:CGSizeMake(10.0f, 10.0f)];
[self setTrackImage:trackImage];
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
[self setTintColor:trackColor];
}
}
- (void)configureFlatProgressViewWithProgressColor:(UIColor *)progressColor {
UIImage *progressImage = [UIImage imageWithColor:progressColor cornerRadius:4.0];
[self setProgressImage:progressImage];
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.1" options:NSNumericSearch] != NSOrderedAscending) {
[self setTintColor:progressColor];
}
}
- (void) configureFlatProgressViewWithTrackColor:(UIColor *)trackColor
progressColor:(UIColor *)progressColor {
[self configureFlatProgressViewWithTrackColor:trackColor];
[self configureFlatProgressViewWithProgressColor:progressColor];
}
@end