Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
432 views
in Technique[技术] by (71.8m points)

ios - How to turn off the automatic gesture to go back a view with a navigation controller?

So I'm noticing all of my views are receiving the gesture to go back (pop a view) when the user swipes on the very left side of the screen (in either orientation) (This is new with iOS7)

I've tried so far with no avail to turn it off using:

    [self.navigationItem setHidesBackButton:YES];

Within the init of the NavigationController itself (as the delegate seems to be using that).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

obj-c

self.navigationController.interactivePopGestureRecognizer.enabled = NO;

swift

navigationController?.interactivePopGestureRecognizer?.isEnabled = false

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...