BindingTelAndThirdpartyTableViewCell.m
2.06 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
62
63
64
65
66
67
68
69
70
71
72
73
//
// BindingTelAndThirdpartyTableViewCell.m
// IVTMeLiveTwo
//
// Created by XRG on 16/8/24.
// Copyright © 2016年 QLQ. All rights reserved.
//
#import "BindingTelAndThirdpartyTableViewCell.h"
@interface BindingTelAndThirdpartyTableViewCell ()
{
UIImageView *headerImageView;
UILabel *headerTitleLabel;
UIButton *bindingButton;
}
@end
@implementation BindingTelAndThirdpartyTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
headerImageView = [[UIImageView alloc]initWithFrame:CGRectMake(16, 10, 30, 30)];
[self.contentView addSubview:headerImageView];
headerTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(headerImageView.frame) + 5, 10, 100, 30)];
[self.contentView addSubview:headerTitleLabel];
bindingButton = [UIButton buttonWithType:UIButtonTypeCustom];
[bindingButton setImage:[UIImage imageNamed:@"未绑定"] forState:UIControlStateNormal];
[bindingButton setImage:[UIImage imageNamed:@"已绑定"] forState:UIControlStateSelected];
bindingButton.frame = CGRectMake(kScreenWidth - 76, 10, 60, 30);
[self.contentView addSubview:bindingButton];
}
return self;
}
- (void)setHeaderImageName:(NSString *)headerImageName{
_headerImageName = headerImageName;
headerImageView.image = [UIImage imageNamed:_headerImageName];
}
- (void)setTitleString:(NSString *)titleString{
_titleString = titleString;
headerTitleLabel.text = _titleString;
}
- (void)setIsBinding:(BOOL)isBinding{
_isBinding = isBinding;
if (_isBinding) {
bindingButton.selected = YES;
}
else{
bindingButton.selected = NO;
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end