// // CameraNoParyBackVideoView.m // Ifish // // Created by imac on 16/12/13. // Copyright © 2016年 lianxiang. All rights reserved. // #import "CameraNoParyBackVideoView.h" @interface CameraNoParyBackVideoView() @property(nonatomic,strong) UIImageView *backImg; @property(nonatomic,strong) UILabel *title; @property(nonatomic,strong) UILabel *subTitle; @end @implementation CameraNoParyBackVideoView -(id)initWithFrame:(CGRect)frame { self=[super initWithFrame:frame]; if (self) { CGFloat viewH =200; UIView *holdView = [[UIView alloc] initWithFrame:CGRectMake(0,frame.size.height/2 -viewH, kScreenSize.width, viewH)]; self.backgroundColor = TABLE_BACKGROUD_COLOR; holdView.backgroundColor = TABLE_BACKGROUD_COLOR; //self.backgroundColor = [UIColor redColor]; UIImageView *backImg = [[UIImageView alloc] init ]; self.backImg = backImg; [holdView addSubview:backImg]; UILabel *title=[[UILabel alloc] init]; title.textAlignment = NSTextAlignmentCenter; title.font =[UIFont systemFontOfSize:16]; title.textColor = RGB(146, 146, 146); self.title = title; [holdView addSubview:title]; UILabel *subtitle=[[UILabel alloc] init]; subtitle.textAlignment = NSTextAlignmentCenter; subtitle.font =[UIFont systemFontOfSize:13]; subtitle.textColor = RGB(146, 146, 146); self.subTitle = subtitle; [holdView addSubview:subtitle]; [self addSubview:holdView]; } return self; } -(void)resetFrame{ if (self.dataType == noDataViewTypeNOSDCard) { CGFloat imgX = self.frame.size.width/2 - 110*KWidth_Scale/2; self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,110*KWidth_Scale, 110*KWidth_Scale*0.82); self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 20 , self.frame.size.width,20); self.subTitle.frame = CGRectMake(0, CGRectGetMaxY(self.title.frame) + 10, self.frame.size.width,20); }else{ CGFloat imgX = self.frame.size.width/2 - 90*KWidth_Scale/2; self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,90*KWidth_Scale, 90*KWidth_Scale*0.86); self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 23 , self.frame.size.width,20); //self.backgroundColor = [UIColor blueColor]; } } -(void)setViewData:(UIImage *)imag title:(NSString *)title subTitle:(NSString *)subTitle { [self resetFrame]; self.backImg.image =imag; self.title.text = title; self.subTitle.text = subTitle; } @end