摇动后视图不响应触摸
在我的应用程序中,我实现了一个摇动事件,它显示了一个 UIImageView。当显示 UIImageView 时,我隐藏导航栏:
[self.navigationController setNavigationBarHidden:YES animated:NO];
然后我想在用户触摸屏幕时将其恢复:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[[self navigationController] setNavigationBarHidden:NO animated:YES];
}
但它不起作用!就像我的视图对触摸没有反应一样。
提前致谢!
In my app I've implemented a shake event and it shows a UIImageView. When the UIImageView is shown, I hide the Nav Bar with:
[self.navigationController setNavigationBarHidden:YES animated:NO];
And after that I want to bring it back when user touches the screen:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[[self navigationController] setNavigationBarHidden:NO animated:YES];
}
But it doesn't work! Like my view doesn't respond to touches.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要在视图上启用用户交互(如果尚未启用)。
You many need to enable user interaction on your view if it isn't already.