forked from coding/Coding-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointTopCell.m
More file actions
60 lines (54 loc) · 1.84 KB
/
PointTopCell.m
File metadata and controls
60 lines (54 loc) · 1.84 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
56
57
58
59
60
//
// PointTopCell.m
// Coding_iOS
//
// Created by Ease on 15/8/5.
// Copyright (c) 2015年 Coding. All rights reserved.
//
#import "PointTopCell.h"
@interface PointTopCell ()
@property (strong, nonatomic) UILabel *valueL, *titleL;
@end
@implementation PointTopCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
self.selectionStyle = UITableViewCellSelectionStyleNone;
if (!_valueL) {
_valueL = [UILabel new];
_valueL.textColor = kColorBrandGreen;
_valueL.font = [UIFont systemFontOfSize:50];
_valueL.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:_valueL];
}
if (!_titleL) {
_titleL = [UILabel new];
_titleL.textColor = kColor999;
_titleL.font = [UIFont systemFontOfSize:12];
_titleL.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:_titleL];
_titleL.text = @"码币余额";
}
[_valueL mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.contentView);
// make.top.equalTo(self.contentView).offset(20);
make.centerY.equalTo(self.contentView).offset(-10);
make.height.mas_equalTo(50);
}];
[_titleL mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_valueL.mas_bottom).offset(5);
make.centerX.equalTo(_valueL);
make.height.mas_equalTo(15);
}];
}
return self;
}
- (void)setPointLeftStr:(NSString *)pointLeftStr{
_pointLeftStr = pointLeftStr;
_valueL.text = _pointLeftStr;
}
+ (CGFloat)cellHeight{
return 150.0;
}
@end