//
|
// PBPersonCollectionViewCell.m
|
// IphoneBIMe
|
//
|
// Created by zjf on 2018/8/16.
|
// Copyright © 2018年 ProBIM. All rights reserved.
|
//
|
|
#import "PBPersonCollectionViewCell.h"
|
@interface PBPersonCollectionViewCell()
|
@property (nonatomic, weak) UILabel *personNameL;
|
@end
|
@implementation PBPersonCollectionViewCell
|
- (instancetype)initWithFrame:(CGRect)frame {
|
if (self = [super initWithFrame:frame]) {
|
[self setupUI];
|
}
|
return self;
|
}
|
- (void)setupUI {
|
UILabel *personNameL = [UILabel z_labelWithText:@"" Color:WarningColor isBold:NO Font:12];
|
personNameL.textAlignment = NSTextAlignmentCenter;
|
[self.contentView addSubview:personNameL];
|
[personNameL mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(self.contentView).offset(8);
|
make.bottom.equalTo(self.contentView).offset(-8);
|
make.left.equalTo(self.contentView).offset(2);
|
make.right.equalTo(self.contentView).offset(-2);
|
}];
|
self.personNameL = personNameL;
|
}
|
-(void)setName:(NSString *)name {
|
_name = name;
|
self.personNameL.text = name;
|
}
|
- (void)setRoleType:(RoleType)roleType {
|
_roleType = roleType;
|
if (roleType == CREATOR) {
|
self.contentView.backgroundColor = [UIColor z_colorWithR:255 G:170 B:0 alpha:0.12];
|
self.personNameL.textColor = WarningColor;
|
}else {
|
self.contentView.backgroundColor = [UIColor whiteColor];
|
self.personNameL.textColor = PromptColor;
|
}
|
}
|
@end
|