IVTMyAccountTableViewCell.m
2.02 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
61
//
// IVTMyAccountTableViewCell.m
// IVTMeLive
//
// Created by xrg on 16/7/19.
// Copyright © 2016年 Joky. All rights reserved.
//
#import "IVTMyAccountTableViewCell.h"
@implementation IVTMyAccountTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
_goldImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"中国币"]];
_goldImg.frame = CGRectMake(16 , 13, 20, 20);
[self.contentView addSubview:_goldImg];
_choice = [[UILabel alloc] initWithFrame:CGRectMake(_goldImg.frame.size.width +20, 10, 100, 30)];
_choice.textColor = [UIColor IVTMainTextColor];
_choice.font = [UIFont IVTH3Font];
_choice.textAlignment = 0;
[self.contentView addSubview:_choice];
_charge = [UIButton buttonWithType:UIButtonTypeCustom];
_charge.frame = CGRectMake(kScreenWidth - 76, 10, 60, 25);
[_charge setTitle:@"¥6" forState:UIControlStateNormal];
[_charge setTitleColor:[UIColor IVTLightRedColor] forState:UIControlStateNormal];
_charge.titleLabel.font = [UIFont YXFontOfSize:17];
_charge.layer.borderWidth = 1;
_charge.layer.borderColor = [UIColor IVTLightRedColor].CGColor;
_charge.layer.masksToBounds = YES;
_charge.layer.cornerRadius = 5;
[self.contentView addSubview:_charge];
}
return self;
}
- (void)setAccountModel:(IVTMyAccountTableViewModel *)model
{
_accountModel = model;
_choice.text = [NSString stringWithFormat:@"%@中国币", _accountModel.chineseCoin];
[_charge setTitle:[NSString stringWithFormat:@"¥%@",_accountModel.price] forState:UIControlStateNormal];
}
@end