-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTSListTableViewCell.m
More file actions
55 lines (48 loc) · 1.74 KB
/
Copy pathTSListTableViewCell.m
File metadata and controls
55 lines (48 loc) · 1.74 KB
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
//
// TSListTableViewCell.m
// TSCategories
//
// Created by Awais Hussain on 7/26/13.
// Copyright (c) 2013 TimeStamp. All rights reserved.
//
#define PI 3.1415
#import "TSListTableViewCell.h"
#import <QuartzCore/QuartzCore.h>
#import "UIColor+CalendarPalette.h"
@interface TSListTableViewCell () {
CGFloat circleDiameter;
}
@end
@implementation TSListTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
self.backgroundColor = [UIColor clearColor];
self.textLabel.textAlignment = NSTextAlignmentCenter;
self.textLabel.backgroundColor = [UIColor clearColor];
self.textLabel.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:15.0];
self.textLabel.adjustsFontSizeToFitWidth = YES;
self.textLabel.minimumScaleFactor = 0.8f;
self.textLabel.numberOfLines = 2;
if (self.bounds.size.height > self.bounds.size.width) {
circleDiameter = self.bounds.size.width;
} else {
circleDiameter = self.bounds.size.height;
}
self.contentView.layer.cornerRadius = BOX_HEIGHT / 2.0;
}
return self;
}
- (void)setSelected:(BOOL)selected {
[super setSelected:selected];
self.selectedBackgroundView.backgroundColor = [UIColor colorFromHexString:@"#dddddd"];
self.selectedBackgroundView.layer.borderColor = self.color.CGColor;
self.selectedBackgroundView.layer.borderWidth = 6.0;
self.selectedBackgroundView.layer.cornerRadius = BOX_HEIGHT / 2.0;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:NO];
}
@end