80 lines
1.8 KiB
Objective-C
80 lines
1.8 KiB
Objective-C
//
|
|
// SessionNavLiveView.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2023/1/17.
|
|
//
|
|
|
|
#import "SessionNavLiveView.h"
|
|
///Third
|
|
#import <Masonry/Masonry.h>
|
|
///Tool
|
|
#import "DJDKMIMOMColor.h"
|
|
|
|
@interface SessionNavLiveView ()
|
|
|
|
///音符
|
|
@property (nonatomic,strong) UIImageView *liveView;
|
|
///直播中
|
|
@property (nonatomic,strong) UILabel *liveLabel;
|
|
|
|
@end
|
|
|
|
@implementation SessionNavLiveView
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
self = [super initWithFrame:frame];
|
|
if (self) {
|
|
[self initSubViews];
|
|
[self initSubViewConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
#pragma mark - Private Method
|
|
- (void)initSubViews {
|
|
[self addSubview:self.liveView];
|
|
[self addSubview:self.liveLabel];
|
|
}
|
|
|
|
- (void)initSubViewConstraints {
|
|
|
|
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.height.mas_equalTo(15);
|
|
make.right.mas_equalTo(self.liveLabel.mas_right);
|
|
}];
|
|
|
|
[self.liveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.size.mas_equalTo(CGSizeMake(6, 6));
|
|
make.centerY.mas_equalTo(self);
|
|
make.left.mas_equalTo(self);
|
|
}];
|
|
|
|
[self.liveLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(self.liveView.mas_right).offset(4);
|
|
make.centerY.mas_equalTo(self.liveView);
|
|
}];
|
|
}
|
|
#pragma mark - Getters And Setters
|
|
- (UIImageView *)liveView {
|
|
if (!_liveView) {
|
|
_liveView = [[UIImageView alloc] init];
|
|
_liveView.userInteractionEnabled = YES;
|
|
_liveView.image = [UIImage imageNamed:@"session_nav_live"];
|
|
}
|
|
return _liveView;
|
|
}
|
|
|
|
- (UILabel *)liveLabel {
|
|
if (!_liveLabel) {
|
|
_liveLabel = [[UILabel alloc] init];
|
|
_liveLabel.font = [UIFont systemFontOfSize:10];
|
|
_liveLabel.textColor = [DJDKMIMOMColor textThirdColor];
|
|
_liveLabel.text = [NSString stringWithFormat:@"%@ >",YMLocalizedString(@"SessionNavLiveView0")];
|
|
}
|
|
return _liveLabel;
|
|
}
|
|
|
|
|
|
@end
|