// // CameraViewCell.m // Ifish // // Created by imac on 16/7/8. // Copyright © 2016年 lianxiang. All rights reserved. // #import "CameraViewCell.h" @implementation CameraViewCell - (instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { //这里需要初始化ImageView; self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0,self.frame.size.height - 30 , self.frame.size.height - 30 )]; self.imageView.backgroundColor = [UIColor colorWithRed:64/255.0f green:64/255.0 blue:64/255.0f alpha:1.0]; [self.imageView setUserInteractionEnabled:true]; self.descbutton = [[UIButton alloc] initWithFrame:CGRectMake(0, self.frame.size.height - 20 , self.frame.size.width - 26, 24)]; [self.descbutton.titleLabel setTextColor:[UIColor whiteColor]]; [self.descbutton.titleLabel setFont:[UIFont systemFontOfSize:12]]; self.descbutton.titleLabel.numberOfLines = 0; [self.descbutton.titleLabel sizeToFit]; self.descbutton.titleLabel.textAlignment = NSTextAlignmentLeft; self.point = [[UIView alloc] initWithFrame:CGRectMake(-15, self.frame.size.height - 20 + 6 , 10, 10)]; self.point.backgroundColor = [UIColor greenColor]; [self.point.layer setBorderWidth:0.1]; [self.point.layer setCornerRadius:5]; [self.point setClipsToBounds:YES]; //先设置不可见 [self.point setHidden:YES]; self.deleteButton = [[UIButton alloc] initWithFrame:CGRectMake(self.frame.size.width - 50, 0, 30, 30)]; [self.deleteButton setImage:[UIImage imageNamed:@"device_del"] forState:UIControlStateNormal]; //先设置不可见; [self.deleteButton setHidden:YES]; [self addSubview:self.descbutton]; [self addSubview:self.imageView]; [self addSubview:self.deleteButton]; [self addSubview:self.point]; } return self; } @end