iOS 6 UIGestures (Tap) stops working with QLPreviewController

☆樱花仙子☆ 提交于 2019-12-17 19:25:47

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/12675378/ios-6-uigestures-tap-stops-working-with-qlpreviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!