forked from soffes/cheddar-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIButton+CheddariOSAdditions.m
65 lines (55 loc) · 3.42 KB
/
UIButton+CheddariOSAdditions.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// UIButton+CheddariOSAdditions.m
// Cheddar for iOS
//
// Created by Sam Soffes on 5/16/12.
// Copyright (c) 2012 Nothing Magical. All rights reserved.
//
#import "UIButton+CheddariOSAdditions.h"
#import "UIFont+CheddariOSAdditions.h"
#import "UIColor+CheddariOSAdditions.h"
@implementation UIButton (CheddariOSAdditions)
+ (UIButton *)cheddarBigButton {
UIButton *button = [[self alloc] initWithFrame:CGRectZero];
[button setBackgroundImage:[[UIImage imageNamed:@"big-button.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:0] forState:UIControlStateNormal];
[button setBackgroundImage:[[UIImage imageNamed:@"big-button-highlighted.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:0] forState:UIControlStateHighlighted];
[button setTitleColor:[UIColor colorWithRed:0.384 green:0.412 blue:0.455 alpha:1] forState:UIControlStateNormal];
[button setTitleShadowColor:[UIColor whiteColor] forState:UIControlStateNormal];
button.titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
button.titleLabel.font = [UIFont cheddarFontOfSize:18.0f];
return button;
}
+ (UIButton *)cheddarBigOrangeButton {
UIButton *button = [[self alloc] initWithFrame:CGRectZero];
[button setBackgroundImage:[[UIImage imageNamed:@"big-orange-button.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateNormal];
[button setBackgroundImage:[[UIImage imageNamed:@"big-orange-button-highlighted.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateHighlighted];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button setTitleShadowColor:[UIColor colorWithWhite:0.0f alpha:0.2f] forState:UIControlStateNormal];
button.titleLabel.font = [UIFont cheddarFontOfSize:20.0f];
button.titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
button.titleEdgeInsets = UIEdgeInsetsMake(-1.0f, 0.0f, 0.0f, 0.0f);
return button;
}
+ (UIButton *)cheddarBigGrayButton {
UIButton *button = [[self alloc] initWithFrame:CGRectZero];
[button setBackgroundImage:[[UIImage imageNamed:@"big-gray-button.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateNormal];
[button setBackgroundImage:[[UIImage imageNamed:@"big-gray-button-highlighted.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateHighlighted];
[button setTitleColor:[UIColor cheddarSteelColor] forState:UIControlStateNormal];
[button setTitleShadowColor:[UIColor whiteColor] forState:UIControlStateNormal];
button.titleLabel.font = [UIFont cheddarFontOfSize:20.0f];
button.titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
button.titleEdgeInsets = UIEdgeInsetsMake(-1.0f, 0.0f, 0.0f, 0.0f);
return button;
}
+ (UIButton *)cheddarBarButton {
UIButton *button = [[self alloc] initWithFrame:CGRectZero];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button setTitleShadowColor:[UIColor colorWithWhite:0.0f alpha:0.2f] forState:UIControlStateNormal];
[button setBackgroundImage:[[UIImage imageNamed:@"nav-button.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:0] forState:UIControlStateNormal];
[button setBackgroundImage:[[UIImage imageNamed:@"nav-button-highlighted.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:0] forState:UIControlStateHighlighted];
button.titleLabel.font = [UIFont cheddarFontOfSize:14.0f];
button.titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
// button.titleEdgeInsets = UIEdgeInsetsMake(-1.0f, 0.0f, 0.0f, 0.0f);
return button;
}
@end