123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // CustomNavigationController.m
- //
- // Created by Simon on 2019/3/22.
- // Copyright © 2019 Simon. All rights reserved.
- //
- #import "CustomNavigationController.h"
- @implementation CustomNavigationController
- - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self) {
- // Custom initialization
- }
- return self;
- }
- - (void)viewDidLoad{
- [super viewDidLoad];
-
- [self setNavigationBarHidden:NO]; // 使导航条有效
- [self.navigationBar setHidden:YES]; // 隐藏导航条,但由于导航条有效,系统的返回按钮页有效,所以可以使用系统的右滑返回手势。
- [self.navigationBar setBarTintColor:[UIColor whiteColor]];
-
- }
- - (void)didReceiveMemoryWarning{
- [super didReceiveMemoryWarning];
- }
- // 是否可右滑返回
- - (void)navigationCanDragBack:(BOOL)bCanDragBack{
- self.interactivePopGestureRecognizer.enabled = bCanDragBack;
- }
- @end
|