123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- //
- // NoDataView.m
- // ZBProject
- //
- // Created by 学丽 on 2019/4/24.
- // Copyright © 2019 ZB. All rights reserved.
- //
- #import "NoDataView.h"
- @implementation NoDataView
- -(instancetype)initWithFrame:(CGRect)frame
- {
- self=[super initWithFrame:frame];
- if (self) {
- [self setUIs];
- }
- return self;
- }
- -(void)setIsShowNoDataView:(BOOL)isShowNoDataView
- {
- _isShowNoDataView = isShowNoDataView;
- }
- -(void)setFrame:(CGRect)frame AndImg:(NSString *)img title:(NSString *)title isShow:(BOOL)isshow
- {
- self.frame=frame;
- self.imgView.image=[UIImage imageNamed:img];
- self.tipeLabel.text=title;
- if (!isshow) {
- self.hidden=YES;
- }else{
- self.hidden=NO;
- }
- }
- -(void)setUIs
- {
-
- [self addSubview:self.imgView];
-
-
- [self addSubview:self.tipeLabel];
-
- [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.mas_equalTo(self.mas_centerX);
- make.centerY.mas_equalTo(self.mas_centerY);
- make.width.height.mas_equalTo(100);
- }];
- [self.tipeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.mas_equalTo(0);
- make.height.mas_equalTo(20);
- make.top.mas_equalTo(self.imgView.mas_bottom);
- }];
- }
- -(UIImageView *)imgView
- {
- if (!_imgView) {
- _imgView =[[UIImageView alloc]init];
- _imgView.image=[UIImage imageNamed:@"no_order"];
- }
- return _imgView;
- }
- -(UILabel *)tipeLabel
- {
- if (!_tipeLabel) {
- _tipeLabel =[[UILabel alloc]init];
- _tipeLabel.text=@"还没有记录";
- _tipeLabel.font=[UIFont systemFontOfSize:14];
- _tipeLabel.textColor=[UIColor YHColorWithHex:0x333333];
- _tipeLabel.textAlignment=NSTextAlignmentCenter;
- }
- return _tipeLabel;
- }
- @end
|