80 lines
1.9 KiB
Objective-C
80 lines
1.9 KiB
Objective-C
//
|
|
// CustomMapMessageCell.m
|
|
// XinjiangProject
|
|
//
|
|
// Created by Apple on 2024/6/12.
|
|
//
|
|
|
|
#import "CustomMapMessageCell.h"
|
|
|
|
@interface CustomMapMessageCell ()
|
|
|
|
@property (nonatomic, strong) UIImageView * heardImage;
|
|
|
|
@property (nonatomic, strong) UILabel * connetLabel;
|
|
|
|
|
|
@end
|
|
|
|
@implementation CustomMapMessageCell
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
// Initialization code
|
|
}
|
|
|
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
|
[super setSelected:selected animated:animated];
|
|
|
|
// Configure the view for the selected state
|
|
}
|
|
|
|
|
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
|
{
|
|
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
|
if (self) {
|
|
|
|
[self createUI];
|
|
|
|
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)createUI {
|
|
|
|
self.heardImage = [[UIImageView alloc] init];
|
|
self.heardImage.backgroundColor = KRedColor;
|
|
[self.contentView addSubview:self.heardImage];
|
|
self.heardImage.layer.cornerRadius = 15;
|
|
self.heardImage.layer.masksToBounds = true;
|
|
[self.heardImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
make.left.mas_equalTo(@15);
|
|
make.top.mas_equalTo(@8);
|
|
make.height.width.mas_equalTo(@30);
|
|
}];
|
|
|
|
self.connetLabel = [[UILabel alloc] init];
|
|
self.connetLabel.backgroundColor = KRedColor;
|
|
[self.contentView addSubview:self.heardImage];
|
|
self.connetLabel.layer.cornerRadius = 10;
|
|
self.connetLabel.layer.masksToBounds = true;
|
|
self.connetLabel.numberOfLines = 0;
|
|
[self.connetLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
make.left.mas_equalTo(self.heardImage.right).offset(8);
|
|
make.top.mas_equalTo(@10);
|
|
make.width.mas_equalTo(@245.0);
|
|
}];
|
|
[self.connetLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|