This commit is contained in:
2025-12-03 14:30:02 +08:00
parent c1eb6a3458
commit 599a5de3bc
9 changed files with 180 additions and 66 deletions

View File

@@ -15,6 +15,7 @@
//
@property (nonatomic, strong) UIImageView *bgImageView; // login_bg_icon
@property (nonatomic, strong) UIImageView *topRightImageView; // login_jianp_icon
@property (nonatomic, strong) UIButton *backButton; //
// 26
@property (nonatomic, strong) UIView *contentContainerView;
@@ -74,6 +75,14 @@
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
//
[self.view addSubview:self.backButton];
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.view).offset(16);
make.top.equalTo(self.view).offset(KB_StatusBarHeight() + 8);
make.width.height.mas_equalTo(32);
}];
//
[self.view addSubview:self.topRightImageView];
@@ -165,7 +174,7 @@
id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
if ([appDelegate respondsToSelector:@selector(setupRootVC)]) {
AppDelegate *delegate = (AppDelegate *)appDelegate;
[delegate setupRootVC];
[delegate toMainTabbarVC];
}
});
} else {
@@ -195,6 +204,15 @@
KBLOG(@"onTapForgotPassword");
}
- (void)onTapBack {
// BaseViewController pop dismiss
if (self.navigationController && self.navigationController.viewControllers.count > 1) {
[self.navigationController popViewControllerAnimated:YES];
} else if (self.presentingViewController) {
[self dismissViewControllerAnimated:YES completion:nil];
}
}
#pragma mark - Lazy UI
- (UIImageView *)bgImageView {
@@ -223,6 +241,21 @@
return _contentContainerView;
}
- (UIButton *)backButton {
if (!_backButton) {
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *img = [UIImage imageNamed:@"back"];
if (!img) { img = [UIImage imageNamed:@"back_black_icon"]; }
if (img) {
[_backButton setImage:img forState:UIControlStateNormal];
}
_backButton.adjustsImageWhenHighlighted = YES;
_backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[_backButton addTarget:self action:@selector(onTapBack) forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel new];