When we use a custom button to Popviewcontroller and hide the system Navigationbar,
(Self.navigationController.navigationBarHidden = YES;)
The Navigationbar system comes with a slip gesture that does not exist.
Of course we can slide gestures on the current view, but there are bugs, especially views such as ScrollView, TableView, and so on in the view.
Here's a more ingenious way to combine custom backbtn with system side-slip:
-(void) Viewwillappear: (BOOL) animated { [Super viewwillappear:animated]; Self.navigationController.navigationBar.alpha = 0; Self.navigationController.navigationBarHidden = YES;} -(void) Viewwilldisappear: (BOOL) animated { [Super viewwilldisappear:animated]; Self.navigationController.navigationBar.alpha = 1; Self.navigationController.navigationBarHidden = NO;}
Can be seen, and there is noNavigationbar is hidden, but the transparency is adjusted to 0, the transparency is 0 o'clock Navigationbar will not occupy the position,
But the side-slip feature is still in. In the process, it is found that the backbtn and title of system Navigationbar will appear when half-slide
Therefore, these two items can be set to nil. Note: These settings for Navigationbar are all global in effect,
Be aware of the appropriate processing at different stages of the view life cycle.
In summary, when we want to not use the system Navigationbar view, but only use its slide gesture,
To use the view lifecycle flexibly,
Self.navigationController.navigationBar.alpha = 0; Self.navigationController.navigationBar.alpha = 1;
To switch in a timely manner, the systemNavigationbar'sBackitem and other members may be hidden in time.
IOS "Custom Back button" is used in combination with "system slide"