objective c - iOS - pop a view controller by panning on the left edge, navigation bar disappears -
so ios 7 introduced new feature can pop view controller panning on left edge. here problem: have 2 view controllers, , b, connected push segue. both of controllers have navigation bars (by embedding in navigation controller). navigation bar in b hidden once user enters b's scene, , can shown if user taps on scene. if user pans on left edge of b while navigation bar hidden, navigation bar in hidden well, means there no way user return further a. there way enforce show navigation bar regardless of b has hidden bar or not? or there easy way prevent pan gesture taking effect? read this post suggested way of preventing pan, can't locate property in storyboard.
edit: disabled interactive pop gesture recognizer solved half of problem. other half if click button on child view controller navigation bar when navigation bar disappearing, navigated parent view controller without navigation bar. tried calling [self.navigationcontroller setnavigationbarhidden:no]
in viewwillappear
, viewdidload
not work. sort of bug in sdk or missing something?
here code hiding navigation bar in child view controller
- (void)hidenavigationbar { if (self.navigationbarhidden == no) { [uiview animatewithduration:uinavigationcontrollerhideshowbarduration animations:^{ self.navigationcontroller.navigationbar.alpha = 0.0; self.previewcollectionview.alpha = 0.0; } completion:^(bool finished) { self.navigationbarhidden = yes; }]; } }
yes, can enforce navigation bar's appearance in viewcontroller's -viewwillappear
method.
also, since cannot find interactivepopgesturerecognizer
property in storyboard, can use line in viewcontroller's -viewdidload method:
self.navigationcontroller.interactivepopgesturerecognizer.enabled = no;
edit:
in viewwillappear method
, have call:
[self.navigationcontroller setnavigationbarhidden:no]; self.navigationcontroller.navigationbar.alpha = 1.0;
Comments
Post a Comment