This commit is contained in:
lianxiang
2018-09-06 21:19:50 +08:00
parent 17d4481f2c
commit 0f09748cc8
69 changed files with 966 additions and 439 deletions
+12 -5
View File
@@ -8,6 +8,9 @@
#import "GiGaCommentView.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
#import "NSString+Unicode.h"
@interface GiGaCommentView()
@property(nonatomic,strong) UILabel *userName;
@property(nonatomic,strong) UIImageView *userAvtar;
@@ -38,12 +41,10 @@
-(void)initUI{
UIImageView *avatar = [[UIImageView alloc] init];
avatar.image = [UIImage imageNamed:@"home_login_qq_color"];
//avatar.frame = CGRectMake(3, 3, self.frame.size.height - 6, self.frame.size.height - 6);
avatar.layer.masksToBounds = YES;
avatar.layer.cornerRadius = 15;
[self addSubview:avatar];
avatar.image = [UIImage imageNamed:_msgModel.userAvatar];
[avatar sd_setImageWithURL:[NSURL URLWithString:_msgModel.sendUserHeadImg] placeholderImage:[UIImage imageNamed:@"nav_circle_avatar"]];
self.userAvtar = avatar;
[self.userAvtar mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(30);
@@ -57,7 +58,10 @@
namelabel.font = [UIFont systemFontOfSize:14];
namelabel.textColor = [UIColor blackColor];
//namelabel.frame= CGRectMake(CGRectGetMaxX(avatar.frame) + 5, 4, namelabel.frame.size.width, namelabel.frame.size.height);
namelabel.text = _msgModel.userName;
namelabel.text = @"用户名";
if (_msgModel.sendUserName && _msgModel.sendUserName.length > 0) {
namelabel.text = [_msgModel.sendUserName replaceUnicode:_msgModel.sendUserName];
}
[namelabel sizeToFit];
self.userName = namelabel;
[self addSubview:self.userName];
@@ -73,7 +77,10 @@
msglabel.textColor = [UIColor blackColor];
//msglabel.frame= CGRectMake(namelabel.frame.origin.x, CGRectGetMaxY(avatar.frame) - msglabel.frame.size.height - namelabel.frame.origin.y, msglabel.frame.size.width, msglabel.frame.size.height);
msglabel.text = _msgModel.msg;
msglabel.text = @"信息内容";
if (_msgModel.content && _msgModel.content.length > 0) {
msglabel.text = [_msgModel.content replaceUnicode:_msgModel.content];
}
self.msg = msglabel;
[msglabel sizeToFit];
[self addSubview:self.msg];
@@ -81,7 +81,6 @@
_countLabel.text = @"00:00";
_countLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:22];
}
return _countLabel;
}
@@ -15,7 +15,7 @@
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.8];
self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.2];
[self setUpUI];
}
@@ -24,26 +24,17 @@
-(void)setUpUI{
UIImageView *iconImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]];
iconImg.backgroundColor = [UIColor redColor];
[self addSubview:iconImg];
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.and.height.mas_equalTo(40);
make.left.mas_equalTo(10);
make.centerY.mas_equalTo(self.mas_centerY);
}];
UILabel *waringLabel = [[UILabel alloc] init];
waringLabel.text = @"爱滴,请您务必要开启手机声音哦";
waringLabel.text = @"♥️ 亲,请您务必要开启手机声音哦~";
waringLabel.textColor = [UIColor whiteColor];
waringLabel.textAlignment = NSTextAlignmentCenter;
waringLabel.font = [UIFont systemFontOfSize:12];
waringLabel.font = GIGA_TEXTFONTMEDIUM(14);
[self addSubview:waringLabel];
[waringLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.mas_left).offset(40);
make.left.mas_equalTo(self.mas_left).offset(10);
make.right.mas_equalTo(self.mas_right).offset(-40);
make.centerY.mas_equalTo(self.mas_centerY);
}];