iOS 6 UIGestures(Tap)停止使用QLPreviewController(iOS 6 UIGestures (Tap) stops working with QLPreviewCont

编程入门 行业动态 更新时间:2024-10-25 21:22:37
iOS 6 UIGestures(Tap)停止使用QLPreviewController(iOS 6 UIGestures (Tap) stops working with QLPreviewController)

目前我在导航控制器中使用QLPreviewController。 (pushViewController)

要隐藏导航栏,我使用UITapGestureRecognizer。 用户可以通过单次触摸(点击)显示/隐藏导航栏。 这在iOS5中运行良好

- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]; [tapRecognizer setNumberOfTapsRequired:1]; [tapRecognizer setDelegate:self]; [[self view] addGestureRecognizer:tapRecognizer]; [tapRecognizer release]; } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } - (void)tapped:(UIGestureRecognizer*)gestureRecognizer { //hide -/- show navigation bar [[self navigationController] setNavigationBarHidden:![[[self navigationController] navigationBar] isHidden] animated:YES]; }

但是在发布的iOS 6版本中,水龙头现在完全被忽略了,所以我再也无法隐藏我的导航栏了。

我想隐藏导航栏的原因是什么?

如果您打开.numbers文档,导航栏会隐藏导航栏下的“工作表按钮”。

TY。

Currently I'm using a QLPreviewController in a navigation controller. (pushViewController)

To hide the navigationbar I use a UITapGestureRecognizer. The user can show/hide the navigation bar by a single touch (tap). This worked well in iOS5

- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]; [tapRecognizer setNumberOfTapsRequired:1]; [tapRecognizer setDelegate:self]; [[self view] addGestureRecognizer:tapRecognizer]; [tapRecognizer release]; } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } - (void)tapped:(UIGestureRecognizer*)gestureRecognizer { //hide -/- show navigation bar [[self navigationController] setNavigationBarHidden:![[[self navigationController] navigationBar] isHidden] animated:YES]; }

But in the released version of iOS 6 the taps are now completely ignored, so I can't hide my navigation bar anymore.

Reason why I want to hide the navigation bar?

If you open a .numbers document, the navigationbar hides the 'sheet-buttons' under the navigation bar.

Ty.

最满意答案

从ios 6开始,QLPreviewController实际上是一个完全独立的应用程序(单独的过程和一切)

Apple使用XPC:

http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/

https://twitter.com/eldudi/statuses/253438028163457024

=>所以当你按下它时,你的整个应用程序会移动到bg,包括它的窗口和手势识别器

since ios 6 the QLPreviewController is actually a completely seperate app (seperate process and everything)

Apple uses XPC for that:

http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/

https://twitter.com/eldudi/statuses/253438028163457024

=> so when you push that, your whole app moves to the bg, including its window and gesture recognizers

更多推荐

本文发布于:2023-07-05 01:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1031244.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:停止使用   Tap   UIGestures   iOS   stops

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!