self.navigationItem setHidesBackButton:YES 行为不一致
我试图在动画期间隐藏导航栏“后退”按钮。动画完成后,该按钮将重新出现。
我的代码如下:
- (void) animateResults {
[self hideNavBarButtons];
[self animatePlayer1];
[self animatePlayer2];
[self performSelector:@selector(showNavBarButtons) withObject:nil afterDelay:3.0];
}
- (void) hideNavBarButtons {
[self.navigationItem setHidesBackButton:YES animated:YES];
}
- (void) showNavBarButtons {
[self.navigationItem setHidesBackButton:NO animated:YES];
}
这在模拟器上运行良好......但我在设备上得到奇怪的结果。它非常不一致,并且在几次尝试后停止隐藏“后退”按钮。我假设我有一些代表搞砸了..但我迷路了。任何帮助表示赞赏。
谢谢。
I am trying to hide the navigation bar 'back' button during an animation. When the animation completes, the button re-appears.
my code is as follows:
- (void) animateResults {
[self hideNavBarButtons];
[self animatePlayer1];
[self animatePlayer2];
[self performSelector:@selector(showNavBarButtons) withObject:nil afterDelay:3.0];
}
- (void) hideNavBarButtons {
[self.navigationItem setHidesBackButton:YES animated:YES];
}
- (void) showNavBarButtons {
[self.navigationItem setHidesBackButton:NO animated:YES];
}
This works fine on the simulator... but I get weird results on the device. It is very inconsistent, and stops hiding the 'back' button after a few tries. I am assuming I have some delegates messed up.. but I am lost. Any help is appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论