5
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user