Files
real-e-party-iOS/YuMi/Modules/YMWeb/XPWebViewNavView.m
edwinQQQ a35a711be6 chore: Initial clean commit
- Removed YuMi/Library/ (138 MB, not tracked)
- Removed YuMi/Resources/ (23 MB, not tracked)
- Removed old version assets (566 files, not tracked)
- Excluded Pods/, xcuserdata/ and other build artifacts
- Clean repository optimized for company server deployment
2025-10-09 16:19:14 +08:00

80 lines
2.3 KiB
Objective-C

//
// XPWebViewNavView.m
// YuMi
//
// Created by YuMi on 2023/2/27.
//
#import "XPWebViewNavView.h"
///Third
#import <Masonry/Masonry.h>
#import "UIButton+EnlargeTouchArea.h"
#import "DJDKMIMOMColor.h"
#import "YUMIMacroUitls.h"
@interface XPWebViewNavView()
///返回
@property (nonatomic,strong) UIButton *backButton;
///标题
@property (nonatomic,strong) UILabel *titleView;
@end
@implementation XPWebViewNavView
-(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.backButton];
[self addSubview:self.titleView];
}
- (void)initSubViewConstraints {
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(28));
make.leading.mas_equalTo(0);
make.bottom.mas_equalTo(-kGetScaleWidth(8));
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.backButton);
make.centerX.equalTo(self);
}];
}
-(void)backButtonAction{
if(self.delegate && [self.delegate respondsToSelector:@selector(xPWebViewNavView:didClickBack:)]){
[self.delegate xPWebViewNavView:self didClickBack:self.backButton];
}
}
#pragma mark -懒加载
- (UIButton *)backButton {
if (!_backButton) {
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_backButton setImage:[[UIImage imageNamed:@"common_nav_back"]ms_SetImageForRTL] forState:UIControlStateNormal];
[_backButton setImage:[[UIImage imageNamed:@"common_nav_back"]ms_SetImageForRTL] forState:UIControlStateSelected];
[_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
[_backButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
}
return _backButton;
}
- (UILabel *)titleView {
if (!_titleView) {
_titleView = [[UILabel alloc] init];
_titleView.font = [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold];
_titleView.textColor = UIColorFromRGB(0x1F1B4F);
_titleView.text = YMLocalizedString(@"XPWebViewNavView0");
}
return _titleView;
}
@end