Files
yinmeng-ios/xplan-ios/Main/Monents/View/SubViews/XPMonentPublishSuccessView.m
2022-08-26 21:42:05 +08:00

97 lines
2.5 KiB
Objective-C

//
// XPMonentPublishSuccessView.m
// xplan-ios
//
// Created by 冯硕 on 2022/8/16.
//
#import "XPMonentPublishSuccessView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
@interface XPMonentPublishSuccessView ()
@property (nonatomic, strong) UIImageView *logoImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *tipsLabel;
@end
@implementation XPMonentPublishSuccessView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [UIColor whiteColor];
self.layer.masksToBounds = YES;
self.layer.cornerRadius = 10;
[self addSubview:self.logoImageView];
[self addSubview:self.titleLabel];
[self addSubview:self.tipsLabel];
}
- (void)initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(280, 200));
}];
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(20);
make.centerX.mas_equalTo(self);
make.height.width.mas_equalTo(56);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(20);
make.centerX.mas_equalTo(self);
}];
[self.tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self).inset(15);
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(20);
}];
}
#pragma mark - Getters And Setters
- (UIImageView *)logoImageView {
if (!_logoImageView) {
_logoImageView = [[UIImageView alloc] init];
_logoImageView.userInteractionEnabled = YES;
_logoImageView.image = [UIImage imageNamed:@"monents_publish_success_icon"];
}
return _logoImageView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.text = @"审核中";
_titleLabel.font = [UIFont systemFontOfSize:16];
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
}
- (UILabel *)tipsLabel {
if (!_tipsLabel) {
_tipsLabel = [[UILabel alloc] init];
_tipsLabel.text = @"咻,收到小可爱的动态了呢~\n审核通过后小秘书会帮你发送并通知你哦~";
_tipsLabel.font = [UIFont systemFontOfSize:13];
_tipsLabel.numberOfLines = 0;
_tipsLabel.textColor = UIColorFromRGB(0x999999);
_tipsLabel.textAlignment = NSTextAlignmentCenter;
}
return _tipsLabel;
}
@end