Monday, 15 July 2013

ios - How to hide Navigation Bar without losing slide-back ability -



ios - How to hide Navigation Bar without losing slide-back ability -

i have uitableview , has nav bar(got uinavigationviewcontroller), it's able go sliding using finger.

i tried hide nav bar maintain slide-back ability, code:

- (void)viewwillappear:(bool)animated { [[self navigationcontroller] setnavigationbarhidden:yes animated:yes]; }

this hid nav bar, however, can no longer slide lastly screen either.

is there way hide nav bar maintain slide-back ability?

found solution:

- (void)viewwillappear:(bool)animated { // hide nav bar [[self navigationcontroller] setnavigationbarhidden:yes animated:yes]; // enable slide-back if ([self.navigationcontroller respondstoselector:@selector(interactivepopgesturerecognizer)]) { self.navigationcontroller.interactivepopgesturerecognizer.enabled = yes; self.navigationcontroller.interactivepopgesturerecognizer.delegate = self; } } - (bool)gesturerecognizershouldbegin:(uigesturerecognizer *)gesturerecognizer { homecoming yes; }

and in .h file, conform uigesturerecognizerdelegate

ios objective-c xcode

No comments:

Post a Comment