UINavigationController和后退按钮动作 [英] UINavigationController and back button action
本文介绍了UINavigationController和后退按钮动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个controllers
,第一个是self
,第二个是maincontroller
,在这里我将maincontroller
推入堆栈,所以后退按钮会自动出现. >
在这里,当用户按下后退"按钮时,我需要发出警报.
我该怎么做?
解决方案
或者您可以使用UINavigationController
的委托方法.方法 解决方案
Or you can use the UINavigationController
's delegate methods. The method willShowViewController
is called when the back button of your VC is pressed.
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
这篇关于UINavigationController和后退按钮动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文