Return gesture disappears along with navigation slip
Self.navigationController.navigationBarHidden = YES;
Only disappear navigation
Self.navigationController.navigationBar.hidden = YES;
Navigation controller full Screen slide back effect:
1. The navigation controller's view comes with a swipe gesture, except that the gesture's trigger range is only on the left.
2. When the user drags on the left side of the interface, it will trigger the swipe gesture method, and has the sliding return function, indicating that the system gesture triggering method has realized the sliding return function.
3. Why is the system gesture triggering method already implemented the sliding return function?
Reason:
Uipangesturerecognizer *pan = [[Uipangesturerecognizer alloc] Initwithtarget:target action:action];
When the user slides to the left of the interface, there is a sliding return function, this is because the trigger gesture, call the target action method, the action method to implement the sliding return function, otherwise there will be no sliding back effect
Navigation Controller Full Screen swipe note points:
1. Disable the system from using sliding gestures.
2. Only the non-root controller of the navigation controller needs to trigger gestures, use gesture proxies, and control gesture triggering.
Full-screen Slide code implementation
- (void) viewdidload { [super viewdidload]; // Get the target object with sliding gestures from the system id target = self.interactivepopgesturerecognizer.delegate; // Create a full-screen swipe gesture, The action method of the target that calls the system with the swipe gesture uipangesturerecognizer *pan = [[ Uipangesturerecognizer alloc] initwithtarget:target action: @selector (handlenavigationtransition :)]; // set gesture proxy, intercept gesture trigger pan.delegate = self; // Add full-screen swipe gesture to the view of the navigation controller [self.view addgesturerecognizer:pan] ; // Disable the use of the system's own sliding gestures Self.interactivepopgesturerecognizer.enabled = no;} When to call: The agent is asked before each trigger gesture, whether it is triggered. Action: Intercept gesture Trigger- (BOOL) Gesturerecognizershouldbegin: (uigesturerecognizer *) gesturerecognizer{ // NoteMeaning: Only the non-root controller has the sliding return function, the root controller does not. // determine if the navigation controller has only one sub-controller, if there is only one child controller, it must be the root controller if ( SELF.CHILDVIEWCONTROLLERS.COUNT == 1) { // Indicates that the user does not need to trigger a swipe gesture on the root controller interface, return no; } return yes;}
About customizing the navigation bar, side-by-side return gesture disappears