PGPickerColumnCell.m
1.03 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
//
// PGPickerColumnCell.m
// PGPickerView
//
// Created by piggybear on 2017/7/26.
// Copyright © 2017年 piggybear. All rights reserved.
//
#import "PGPickerColumnCell.h"
@interface PGPickerColumnCell()
@end
#define kContentFont 17
@implementation PGPickerColumnCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = [UIColor clearColor];
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.label.frame = self.contentView.bounds;
}
#pragma Getter
- (UILabel *)label {
if (!_label) {
UILabel *label = [[UILabel alloc]initWithFrame:self.contentView.bounds];
label.font = [UIFont systemFontOfSize:kContentFont];
label.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:label];
_label = label;
}
return _label;
}
@end