|
10 | 10 | #import "UIWindow+SIUtils.h" |
11 | 11 | #import <QuartzCore/QuartzCore.h> |
12 | 12 |
|
| 13 | +#import "UIImage_Tint.h" |
| 14 | + |
13 | 15 | NSString *const SIAlertViewWillShowNotification = @"SIAlertViewWillShowNotification"; |
14 | 16 | NSString *const SIAlertViewDidShowNotification = @"SIAlertViewDidShowNotification"; |
15 | 17 | NSString *const SIAlertViewWillDismissNotification = @"SIAlertViewWillDismissNotification"; |
@@ -1182,12 +1184,18 @@ - (UIButton *)buttonForItemIndex:(NSUInteger)index |
1182 | 1184 | [button setTitleColor:[self.destructiveButtonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted]; |
1183 | 1185 | break; |
1184 | 1186 | case SIAlertViewButtonTypeDefault: |
1185 | | - default: |
1186 | | - normalImage = [UIImage imageNamed:@"SIAlertView.bundle/button-default"]; |
1187 | | - highlightedImage = [UIImage imageNamed:@"SIAlertView.bundle/button-default-d"]; |
1188 | | - [button setTitleColor:self.buttonColor forState:UIControlStateNormal]; |
1189 | | - [button setTitleColor:[self.buttonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted]; |
| 1187 | + default: { |
| 1188 | +// normalImage = [UIImage imageNamed:@"SIAlertView.bundle/button-default"]; |
| 1189 | +// highlightedImage = [UIImage imageNamed:@"SIAlertView.bundle/button-default-d"]; |
| 1190 | +// [button setTitleColor:self.buttonColor forState:UIControlStateNormal]; |
| 1191 | +// [button setTitleColor:[self.buttonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted]; |
| 1192 | + UIColor *tintColor = [[SIAlertView appearance] tintColor]; |
| 1193 | + normalImage = [[UIImage imageNamed:@"SimpleButton"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; |
| 1194 | + normalImage = |
| 1195 | + [normalImage imageTintedWithColor:tintColor]; |
| 1196 | + [button setTitleColor:tintColor forState:UIControlStateNormal]; |
1190 | 1197 | break; |
| 1198 | + } |
1191 | 1199 | } |
1192 | 1200 | CGFloat hInset = floorf(normalImage.size.width / 2); |
1193 | 1201 | CGFloat vInset = floorf(normalImage.size.height / 2); |
|
0 commit comments