//
|
// SearchTipsCell.m
|
// istanbul
|
//
|
// Created by WindShan on 2017/6/16.
|
// Copyright © 2017年 WindShan. All rights reserved.
|
//
|
|
#import "SearchTipsCell.h"
|
#import "GloriaLabel.h"
|
|
@interface SearchTipsCell()
|
{
|
|
}
|
|
@property (nonatomic, strong) GloriaLabel * titleLabel;
|
@property (nonatomic, strong) UIImageView * imageIcon;
|
@end
|
|
@implementation SearchTipsCell
|
|
/*
|
// Only override drawRect: if you perform custom drawing.
|
// An empty implementation adversely affects performance during animation.
|
- (void)drawRect:(CGRect)rect {
|
// Drawing code
|
}
|
*/
|
|
- (void)layoutSubviews
|
{
|
[super layoutSubviews];
|
|
self.titleLabel.frame = CGRectMake(10+22+10, 15,SCREEN_WIDTH-(10+22+10), 22);
|
self.imageIcon.frame = CGRectMake(10, 11, 22, 22);
|
}
|
|
- (UIImageView *)imageIcon
|
{
|
if (!_imageIcon)
|
{
|
_imageIcon = [[UIImageView alloc] initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH-20, 60)];
|
[self.contentView addSubview:_imageIcon];
|
}
|
|
return _imageIcon;
|
}
|
|
- (GloriaLabel *) titleLabel
|
{
|
if(!_titleLabel)
|
{
|
_titleLabel = [[GloriaLabel alloc] initWithFrame:CGRectMake(10+50+10+80, 28,150, 14)];
|
_titleLabel.font = [UIFont systemFontOfSize:14];
|
_titleLabel.textAlignment = UITextAlignmentLeft;
|
_titleLabel.textColor = kUIColorFromRGB(0x595959);
|
[self.contentView addSubview:_titleLabel];
|
}
|
|
return _titleLabel;
|
}
|
|
- (void)setItemView:(NSString *) tips imgName:(NSString *) name
|
{
|
self.imageIcon.image = [UIImage imageNamed:name];
|
[self.titleLabel setText:tips];
|
}
|
|
@end
|