From 9574a71282002f934ea93450d963d376066c4f14 Mon Sep 17 00:00:00 2001 From: zu Date: Thu, 9 Sep 2021 19:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4BaseNavigationController?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios/Base/UI/BaseNavigationController.m | 10 ++++++---- xplan-ios/Main/Login/View/LoginPhoneViewController.m | 5 +++-- xplan-ios/Main/Login/View/LoginViewController.m | 7 ++++--- xplan-ios/Main/Tabbar/TabbarViewController.m | 2 -- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/xplan-ios/Base/UI/BaseNavigationController.m b/xplan-ios/Base/UI/BaseNavigationController.m index 2f8766c5..3ac35862 100644 --- a/xplan-ios/Base/UI/BaseNavigationController.m +++ b/xplan-ios/Base/UI/BaseNavigationController.m @@ -18,17 +18,19 @@ [self themeConfig]; } +- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { + viewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil]; + [super pushViewController:viewController animated:animated]; +} + - (void)themeConfig { self.navigationBar.shadowImage = [[UIImage alloc] init]; self.navigationBar.barTintColor = ThemeBackgroundColor; self.navigationBar.tintColor = [UIColor whiteColor]; self.navigationBar.translucent = NO; - UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil]; - self.navigationItem.backBarButtonItem = item; - [self.navigationBar setTitleTextAttributes:@{ - NSFontAttributeName:[UIFont systemFontOfSize:18], + NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium], NSForegroundColorAttributeName:UIColor.whiteColor }]; } diff --git a/xplan-ios/Main/Login/View/LoginPhoneViewController.m b/xplan-ios/Main/Login/View/LoginPhoneViewController.m index e388e7ba..487541d7 100644 --- a/xplan-ios/Main/Login/View/LoginPhoneViewController.m +++ b/xplan-ios/Main/Login/View/LoginPhoneViewController.m @@ -38,6 +38,7 @@ - (void)viewDidLoad { [super viewDidLoad]; + self.title = @"手机号码登录"; [self initSubViews]; [self initSubViewConstraints]; [self initEevents]; @@ -159,8 +160,8 @@ _nextButton.layer.masksToBounds = YES; _nextButton.layer.cornerRadius = 45/2.f; [_nextButton setTitle:@"下一步" forState:UIControlStateNormal]; - _nextButton.titleLabel.font = [UIFont systemFontOfSize:15]; - [_nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _nextButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; + [_nextButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; _nextButton.enabled = NO; UIImage *image = [UIImage gradientColorImageFromColors:@[ThemeButtonGradientStartColor,ThemeButtonGradientEndColor] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)]; [_nextButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[ThemeTabbarNormalColor, ThemeTabbarNormalColor] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled]; diff --git a/xplan-ios/Main/Login/View/LoginViewController.m b/xplan-ios/Main/Login/View/LoginViewController.m index d236e5dd..844cea45 100644 --- a/xplan-ios/Main/Login/View/LoginViewController.m +++ b/xplan-ios/Main/Login/View/LoginViewController.m @@ -279,7 +279,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) { if (self.agreeButton.isSelected) { if ([view isEqual:self.phoneButtonView]) { LoginPhoneViewController *inputPhoneVC = [[LoginPhoneViewController alloc] init]; - [self.navigationController pushViewController:inputPhoneVC animated:YES]; + [self.navigationController pushViewController:inputPhoneVC animated:YES]; } else if([view isEqual:self.qqButtonView]) { [XCHUDTool showLoading]; // [GetCore(AuthCore) thirdLoginPlatform:SSDKPlatformTypeQQ]; @@ -361,6 +361,8 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) { - (void)phoneQuickLoginFail { [XCHUDTool showErrorWithMessage:@"一键登录失败,请检查手机网络状态。"]; + LoginPhoneViewController *inputPhoneVC = [[LoginPhoneViewController alloc] init]; + [self.navigationController pushViewController:inputPhoneVC animated:YES]; } - (void)configQuickLogin { @@ -455,8 +457,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) { _loginButton.layer.masksToBounds = YES; _loginButton.layer.cornerRadius = 45/2.f; [_loginButton setTitle:@"本机号码一键登录" forState:UIControlStateNormal]; - [_loginButton setTitle:@"本机号码一键登录" forState:UIControlStateSelected]; - _loginButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; + _loginButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; [_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; UIImage *image = [UIImage gradientColorImageFromColors:@[ThemeButtonGradientStartColor,ThemeButtonGradientEndColor] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)]; [_loginButton setBackgroundImage:image forState:UIControlStateNormal]; diff --git a/xplan-ios/Main/Tabbar/TabbarViewController.m b/xplan-ios/Main/Tabbar/TabbarViewController.m index c6fb8da7..d0659451 100644 --- a/xplan-ios/Main/Tabbar/TabbarViewController.m +++ b/xplan-ios/Main/Tabbar/TabbarViewController.m @@ -75,10 +75,8 @@ #endif [self createTabBarItem:fvcGame title:tabLabel[0] image:normalImageNames[0] selectedImage:selectImageNames[0]]; [self addChildViewController:fvcGame]; - [fvcGame.navigationController setNavigationBarHidden:YES]; BaseViewController *bvcMe = [[BaseViewController alloc] init]; - [bvcMe.navigationController setNavigationBarHidden:YES]; [self createTabBarItem:bvcMe title:tabLabel[1] image:normalImageNames[1] selectedImage:selectImageNames[1]]; [self addChildViewController:bvcMe];