61 lines
1.8 KiB
Objective-C
61 lines
1.8 KiB
Objective-C
//
|
|
// MewMainHomeEmptyCell.m
|
|
// xplan-ios
|
|
//
|
|
// Created by duoban on 2023/12/27.
|
|
//
|
|
|
|
#import "MewMainHomeEmptyCell.h"
|
|
@interface MewMainHomeEmptyCell()
|
|
@property (nonatomic,strong) UIImageView *mewEmptyView;
|
|
@property (nonatomic,strong) UILabel *mewtextView;
|
|
@end
|
|
@implementation MewMainHomeEmptyCell
|
|
-(instancetype)initWithFrame:(CGRect)frame{
|
|
self = [super initWithFrame:frame];
|
|
if(self){
|
|
[self installUI];
|
|
[self installConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
-(void)installUI{
|
|
[self.contentView addSubview:self.mewEmptyView];
|
|
[self.contentView addSubview:self.mewtextView];
|
|
}
|
|
-(void)installConstraints{
|
|
[self.mewEmptyView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.centerX.mas_equalTo(self.contentView);
|
|
make.top.mas_equalTo(self.contentView).offset(10);
|
|
make.size.mas_equalTo(CGSizeMake(100, 100));
|
|
}];
|
|
|
|
[self.mewtextView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.top.mas_equalTo(self.mewEmptyView.mas_bottom).offset(20);
|
|
make.left.right.mas_equalTo(self.contentView);
|
|
}];
|
|
}
|
|
#pragma mark - 懒加载
|
|
- (UIImageView *)mewEmptyView {
|
|
if (!_mewEmptyView) {
|
|
_mewEmptyView = [[UIImageView alloc] init];
|
|
_mewEmptyView.userInteractionEnabled = YES;
|
|
_mewEmptyView.image = [UIImageConstant defalutEmptyPlaceholder];
|
|
_mewEmptyView.layer.masksToBounds = YES;
|
|
_mewEmptyView.contentMode = UIViewContentModeScaleAspectFit;
|
|
}
|
|
return _mewEmptyView;
|
|
}
|
|
|
|
- (UILabel *)mewtextView {
|
|
if (!_mewtextView) {
|
|
_mewtextView = [[UILabel alloc] init];
|
|
_mewtextView.text = @"暂无数据";
|
|
_mewtextView.font = [UIFont systemFontOfSize:16];
|
|
_mewtextView.textAlignment = NSTextAlignmentCenter;
|
|
_mewtextView.textColor = [ThemeColor secondTextColor];
|
|
}
|
|
return _mewtextView;
|
|
}
|
|
@end
|