|
//
// userInfoThirdAccountCell.m
// ThePaperBase
//
// Created by Huixin on 15/8/25.
// Copyright (c) 2015年 scar1900. All rights reserved.
//
#import "userInfoThirdAccountCell.h"
@interface userInfoThirdAccountCell ()
@property(nonatomic, strong)UIImageView *icon;
@end
@implementation userInfoThirdAccountCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self addSubview:self.icon];
[self layoutSubViews];
}
return self;
}
- (void)layoutSubViews {
[self.titleLabel remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.top);
make.left.equalTo(self.left).offset(10);
make.width.mas_equalTo(@120);
}];
[self.icon makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.pushIcon.left).offset(-14);
make.centerY.equalTo(self.titleLabel.centerY);
make.width.and.height.mas_equalTo(@14);
}];
}
- (UIImageView*)icon {
if (!_icon) {
_icon = [[UIImageView alloc] init];
_icon.hidden = YES;
}
return _icon;
}
- (void)setLoginType:(NSString *)loginType {
_loginType = loginType;
switch ([loginType integerValue]) {
case 1:
_icon.image = Image(@"login/weChatLoginSmall.png");
_icon.hidden = NO;
break;
case 9:
_icon.image = Image(@"login/QQLoginSmall.png");
_icon.hidden = NO;
break;
case 2:
_icon.image = Image(@"login/sinaLoginSmall.png");
_icon.hidden = NO;
break;
case 20:
_icon.image = Image(@"login/douBanLoginSmall.png");
_icon.hidden = NO;
break;
default:
break;
}
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
|