Files
peko-ios/YuMi/Modules/YMMonents/View/SubViews/XPMonentPublishSuccessView.m
2024-04-11 17:05:27 +08:00

97 lines
2.5 KiB
Objective-C

//
// YMMonentPublishSuccessView.m
// YUMI
//
// Created by YUMI on 2022/8/16.
//
#import "XPMonentPublishSuccessView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "DJDKMIMOMColor.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.leading.trailing.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 = YMLocalizedString(@"XPMonentPublishSuccessView0");
_titleLabel.font = [UIFont systemFontOfSize:16];
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
}
- (UILabel *)tipsLabel {
if (!_tipsLabel) {
_tipsLabel = [[UILabel alloc] init];
_tipsLabel.text = YMLocalizedString(@"XPMonentPublishSuccessView1");
_tipsLabel.font = [UIFont systemFontOfSize:13];
_tipsLabel.numberOfLines = 0;
_tipsLabel.textColor = UIColorFromRGB(0x999999);
_tipsLabel.textAlignment = NSTextAlignmentCenter;
}
return _tipsLabel;
}
@end