//
|
// SearchCell.m
|
// BuWanVideo2.0
|
//
|
// Created by Aeline on 2021/6/26.
|
// Copyright © 2021 com.yeshi.buwansheque.ios. All rights reserved.
|
//
|
|
#import "SearchCell.h"
|
|
@interface SearchCell ()
|
|
@property (nonatomic, nullable, strong) UIImageView *imageViewIcon;
|
@property (nonatomic, nullable, strong) UILabel *labelTitle;
|
@property (nonatomic, nullable, strong) UIImageView *imageViewArrow;
|
|
@property (nonatomic, nullable, strong) UIView *line;
|
@end
|
|
@implementation SearchCell
|
|
- (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.contentView.backgroundColor = [UIColor whiteColor];
|
self.selectionStyle = UITableViewCellSelectionStyleNone;//设置cell点击效果
|
[self setupViewConfig];
|
}
|
return self;
|
}
|
|
- (void)setupViewConfig {
|
[self.contentView addSubview:self.imageViewIcon];
|
[self.contentView addSubview:self.imageViewArrow];
|
[self.contentView addSubview:self.labelTitle];
|
|
[self.contentView addSubview:self.line];
|
|
self.imageViewIcon.sd_layout.leftSpaceToView(self.contentView, 18).centerYEqualToView(self.contentView).widthIs(18).heightIs(18);
|
|
self.imageViewArrow.sd_layout.rightSpaceToView(self.contentView, 18).centerYEqualToView(self.contentView).widthIs(15).heightIs(15);
|
|
|
self.labelTitle.sd_layout.leftSpaceToView(self.imageViewIcon, 17).rightSpaceToView(self.imageViewArrow, 17).centerYEqualToView(self.contentView).heightIs(15);
|
|
|
self.line.sd_layout.leftSpaceToView(self.contentView, 18).bottomEqualToView(self.contentView).rightSpaceToView(self.contentView, 18).heightIs(0.5);
|
}
|
|
- (void)setTitle:(NSString *)title {
|
_title = title;
|
if (title) {
|
self.labelTitle.text = title;
|
}
|
}
|
|
- (UIImageView *)imageViewIcon {
|
if (!_imageViewIcon) {
|
_imageViewIcon = [[UIImageView alloc] init];
|
_imageViewIcon.image = [UIImage imageNamed:@"search_icon"];
|
|
}
|
return _imageViewIcon;
|
}
|
|
- (UILabel *)labelTitle {
|
if (!_labelTitle) {
|
_labelTitle = [[UILabel alloc] init];
|
_labelTitle.textColor = UICOLOR_FROM_RGB(0x000000, 1);
|
_labelTitle.font = [UIFont systemFontOfSize:15];
|
_labelTitle.textAlignment = NSTextAlignmentLeft;
|
}
|
return _labelTitle;
|
}
|
|
- (UIImageView *)imageViewArrow {
|
if (!_imageViewArrow) {
|
_imageViewArrow = [[UIImageView alloc] init];
|
_imageViewArrow.image = [UIImage imageNamed:@"search_arrow"];
|
|
}
|
return _imageViewArrow;
|
}
|
|
- (UIView *)line {
|
if (!_line) {
|
_line = [[UIView alloc] init];
|
_line.backgroundColor = UICOLOR_FROM_RGB(0xDFDFDF, 1);
|
}
|
return _line;
|
}
|
|
@end
|