ifish/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFirstCell.m

50 lines
1.5 KiB
Objective-C

//
// FishControlFirstCell.m
// Ifish
//
// Created by imac on 16/6/29.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "FishControlFirstCell.h"
#import "UIImageView+WebCache.h"
@implementation FishControlFirstCell
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
CGFloat width=self.frame.size.width-20;
CGFloat imgH =width/2;
CGFloat imgY =self.frame.size.height/2 -imgH/2;
self.factoryIcon = [[UIImageView alloc] initWithFrame:CGRectMake(10,imgY,width,width/2)];
[self addSubview:self.factoryIcon];
UIView *shuLine=[[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width - 1,0, 1, self.frame.size.height)];
shuLine.backgroundColor = JWUIColorFromRGB(0xdddddd);
[self addSubview:shuLine];
UIView *hengLine=[[UIView alloc] initWithFrame:CGRectMake(0,self.frame.size.height -1,self.frame.size.width, 1)];
hengLine.backgroundColor = shuLine.backgroundColor = JWUIColorFromRGB(0xdddddd);
[self addSubview:hengLine];
}
return self;
}
-(void)intiFactoryImgWith:(DeviceModel *)devicemodel{
[self.factoryIcon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetLogUrl,devicemodel.logo]] placeholderImage:[UIImage imageNamed:@""]];
if (!self.factoryIcon) {
self.factoryIcon.image = [UIImage imageNamed:@"greenbtn_big"];
}
}
@end