//
|
// ControlViewCell.m
|
// GoldRich
|
//
|
// Created by WindShan on 2017/2/20.
|
// Copyright © 2017年 WindShan. All rights reserved.
|
//
|
|
#import "ControlViewCell.h"
|
#import "GloriaLabel.h"
|
|
@interface ControlViewCell()
|
|
@property (nonatomic, strong) UIImageView * bkImage;
|
@property (nonatomic, strong) UIImageView * shiduImage;
|
@property (nonatomic, strong) GloriaLabel * shuiliangLabel;
|
@property (nonatomic, strong) GloriaLabel * levelLabel;
|
|
@property (nonatomic, strong) GloriaLabel * feiTipsLabel;
|
|
@property (nonatomic, strong) UIImageView * arrowImage;
|
@property (nonatomic, strong) UIImageView * lightBKImage;
|
@property (nonatomic, assign) CGFloat offsetHeight;
|
|
@end
|
|
@implementation ControlViewCell
|
|
/*
|
// 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.bkImage.frame = CGRectMake(0, 5+_offsetHeight, SCREEN_WIDTH, 66);
|
self.shiduImage.frame = CGRectMake(10, 10+_offsetHeight, 50, 50);
|
self.arrowImage.frame = CGRectMake(SCREEN_WIDTH-20-10,27+_offsetHeight, 10, 15);
|
|
self.shuiliangLabel.frame = CGRectMake(10+50+10, 28+_offsetHeight,70, 16);
|
self.levelLabel.frame = CGRectMake(10+50+10+80, 28+_offsetHeight,150, 14);
|
|
self.lightBKImage.frame = CGRectMake(0, -37, SCREEN_WIDTH, 75);
|
self.feiTipsLabel.frame = CGRectMake(10+50+10+80+60, 28+_offsetHeight,70, 16);
|
}
|
|
- (UIImageView *)lightBKImage
|
{
|
if (!_lightBKImage)
|
{
|
_lightBKImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, -37, SCREEN_WIDTH, 75)];
|
[self.contentView addSubview:_lightBKImage];
|
}
|
|
return _lightBKImage;
|
}
|
|
- (UIImageView *)bkImage
|
{
|
if (!_bkImage)
|
{
|
_bkImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 5+_offsetHeight, SCREEN_WIDTH, 66)];
|
[self.contentView addSubview:_bkImage];
|
}
|
|
return _bkImage;
|
}
|
- (UIImageView *)shiduImage
|
{
|
if (!_shiduImage)
|
{
|
_shiduImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5+_offsetHeight, 50, 50)];
|
[self.contentView addSubview:_shiduImage];
|
}
|
|
return _shiduImage;
|
}
|
- (UIImageView *)arrowImage
|
{
|
if (!_arrowImage)
|
{
|
_arrowImage = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-20-10,22+_offsetHeight, 10, 15)];
|
[self.contentView addSubview:_arrowImage];
|
}
|
|
return _arrowImage;
|
}
|
|
- (GloriaLabel *) levelLabel
|
{
|
if(!_levelLabel)
|
{
|
_levelLabel = [[GloriaLabel alloc] initWithFrame:CGRectMake(10+50+10, 23+_offsetHeight,70, 16)];
|
_levelLabel.font = [UIFont systemFontOfSize:10];
|
_levelLabel.textAlignment = UITextAlignmentLeft;
|
_levelLabel.textColor = RgbColor(106,107,107);
|
[self.contentView addSubview:_levelLabel];
|
}
|
|
return _levelLabel;
|
}
|
|
- (GloriaLabel *) feiTipsLabel
|
{
|
if(!_feiTipsLabel)
|
{
|
_feiTipsLabel = [[GloriaLabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-20-10-120, 23+_offsetHeight,70, 16)];
|
_feiTipsLabel.font = [UIFont systemFontOfSize:14];
|
_feiTipsLabel.textAlignment = UITextAlignmentLeft;
|
_feiTipsLabel.textColor = RgbColor(106,107,107);
|
[self.contentView addSubview:_feiTipsLabel];
|
}
|
|
return _feiTipsLabel;
|
}
|
|
|
- (GloriaLabel *) shuiliangLabel
|
{
|
if(!_shuiliangLabel)
|
{
|
_shuiliangLabel = [[GloriaLabel alloc] initWithFrame:CGRectMake(10+50+10+80, 28+_offsetHeight,150, 14)];
|
_shuiliangLabel.font = [UIFont systemFontOfSize:16];
|
_shuiliangLabel.textAlignment = UITextAlignmentLeft;
|
[self.contentView addSubview:_shuiliangLabel];
|
}
|
|
return _shuiliangLabel;
|
}
|
|
|
|
- (void)setItemView:(NSString*)shuiliangStr levelName:(NSString*)levelStr shiduImage:(NSString*)imageName isShowlightBK:(BOOL)isShow
|
{
|
if( isShow)
|
{
|
_offsetHeight = 10;
|
self.lightBKImage.image = [UIImage imageNamed:@"lightBK"];
|
}
|
|
self.bkImage.image = [UIImage imageNamed:@"control_bk"];
|
self.shiduImage.image = [UIImage imageNamed:imageName];
|
|
[self.shuiliangLabel setText:shuiliangStr];
|
|
[self.levelLabel setText:levelStr];
|
|
self.arrowImage.image = [UIImage imageNamed:@"右部箭头"];
|
|
if( isShow)
|
{
|
[self.feiTipsLabel setText:@"(FEI)"];
|
}
|
}
|
|
@end
|