一键匹配增加头像

This commit is contained in:
chenshuanglin
2023-03-20 20:03:26 +08:00
parent 7bb4f2f160
commit 5bfb43093c
10 changed files with 124 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_match_avatar1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_match_avatar1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_match_avatar2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_match_avatar2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_match_avatar3@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_match_avatar3@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -15,6 +15,7 @@
#import "ThemeColor.h" #import "ThemeColor.h"
#import "UIImage+Utils.h" #import "UIImage+Utils.h"
#import "XPCycleVerticalView.h" #import "XPCycleVerticalView.h"
#import "NetImageView.h"
///Model ///Model
#import "XPHomeGiftRecordModel.h" #import "XPHomeGiftRecordModel.h"
#import "HomeMenuInfoModel.h" #import "HomeMenuInfoModel.h"
@@ -33,6 +34,9 @@
@property (nonatomic, strong) UIImageView *greenDot; @property (nonatomic, strong) UIImageView *greenDot;
/// 线 /// 线
@property (nonatomic, strong) UILabel *onlineNumLabel; @property (nonatomic, strong) UILabel *onlineNumLabel;
@property (nonatomic, strong) NetImageView *matchAvatar1;
@property (nonatomic, strong) NetImageView *matchAvatar2;
@property (nonatomic, strong) NetImageView *matchAvatar3;
/// ///
@property (nonatomic, strong) UIImageView *hotView; @property (nonatomic, strong) UIImageView *hotView;
@@ -63,6 +67,9 @@
[self addSubview:self.matchView]; [self addSubview:self.matchView];
[self.matchView addSubview:self.greenDot]; [self.matchView addSubview:self.greenDot];
[self.matchView addSubview:self.onlineNumLabel]; [self.matchView addSubview:self.onlineNumLabel];
[self.matchView addSubview:self.matchAvatar1];
[self.matchView addSubview:self.matchAvatar2];
[self.matchView addSubview:self.matchAvatar3];
[self addSubview:self.hotView]; [self addSubview:self.hotView];
[self.hotView addSubview:self.hotTextImageView]; [self.hotView addSubview:self.hotTextImageView];
[self.hotView addSubview:self.messageView]; [self.hotView addSubview:self.messageView];
@@ -126,6 +133,24 @@
make.size.mas_equalTo(CGSizeMake(4, 4)); make.size.mas_equalTo(CGSizeMake(4, 4));
}]; }];
[self.matchAvatar3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-11);
make.centerY.mas_equalTo(8);
make.width.height.mas_equalTo(22);
}];
[self.matchAvatar2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.matchAvatar3.mas_left).offset(-8);
make.centerY.mas_equalTo(0);
make.width.height.mas_equalTo(36);
}];
[self.matchAvatar1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.matchAvatar2.mas_left).offset(-8);
make.centerY.mas_equalTo(self.matchAvatar3);
make.width.height.mas_equalTo(self.matchAvatar3);
}];
CGFloat hotHeight = 72.0*kScreenScale; CGFloat hotHeight = 72.0*kScreenScale;
[self.hotView mas_makeConstraints:^(MASConstraintMaker *make) { [self.hotView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15); make.left.mas_equalTo(15);
@@ -291,6 +316,39 @@
return _onlineNumLabel; return _onlineNumLabel;
} }
- (NetImageView *)matchAvatar1 {
if (!_matchAvatar1) {
_matchAvatar1 = [[NetImageView alloc] init];
_matchAvatar1.clipsToBounds = YES;
_matchAvatar1.contentMode = UIViewContentModeScaleAspectFill;
_matchAvatar1.image = [UIImage imageNamed:@"home_match_avatar1"];
_matchAvatar1.layer.cornerRadius = 11;
}
return _matchAvatar1;
}
- (NetImageView *)matchAvatar2 {
if (!_matchAvatar2) {
_matchAvatar2 = [[NetImageView alloc] init];
_matchAvatar2.clipsToBounds = YES;
_matchAvatar2.contentMode = UIViewContentModeScaleAspectFill;
_matchAvatar2.image = [UIImage imageNamed:@"home_match_avatar2"];
_matchAvatar2.layer.cornerRadius = 18;
}
return _matchAvatar2;
}
- (NetImageView *)matchAvatar3 {
if (!_matchAvatar3) {
_matchAvatar3 = [[NetImageView alloc] init];
_matchAvatar3.clipsToBounds = YES;
_matchAvatar3.contentMode = UIViewContentModeScaleAspectFill;
_matchAvatar3.image = [UIImage imageNamed:@"home_match_avatar3"];
_matchAvatar3.layer.cornerRadius = 11;
}
return _matchAvatar3;
}
- (UIImageView *)hotView { - (UIImageView *)hotView {
if (!_hotView) { if (!_hotView) {
_hotView = [[UIImageView alloc] init]; _hotView = [[UIImageView alloc] init];