ifish/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m

84 lines
2.6 KiB
Objective-C

//
// 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:self.bounds];
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/2;
self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*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 - 110/2;
self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82);
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