创建nav宏
去除tabbar透明
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self setupTabbarAppearance];
|
||||
// Setup two tabs: Home & My, each embedded in BaseNavigationController
|
||||
HomeMainVC *home = [[HomeMainVC alloc] init];
|
||||
home.title = @"首页";
|
||||
@@ -36,6 +38,18 @@
|
||||
/*[[KBAuthManager shared] saveAccessToken:@"TEST" refreshToken:nil expiryDate:[NSDate dateWithTimeIntervalSinceNow:3600] userIdentifier:nil]*/;
|
||||
}
|
||||
|
||||
- (void)setupTabbarAppearance{
|
||||
// 让 TabBar 不透明,子控制器 view 不再延伸到 TabBar 下
|
||||
self.tabBar.translucent = NO;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
UITabBarAppearance *a = [UITabBarAppearance new];
|
||||
[a configureWithOpaqueBackground];
|
||||
a.backgroundColor = [UIColor whiteColor];
|
||||
self.tabBar.standardAppearance = a;
|
||||
self.tabBar.scrollEdgeAppearance = a;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
|
||||
@@ -83,7 +83,11 @@
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
HomeRankVC *vc = [[HomeRankVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:true];
|
||||
// [self.navigationController pushViewController:vc animated:true];
|
||||
UINavigationController *nav = KB_CURRENT_NAV;
|
||||
[nav pushViewController:vc animated:true];
|
||||
NSLog(@"===");
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Lazy
|
||||
|
||||
Reference in New Issue
Block a user