Quicklook/QLPreviewController, some problems with iOS 8 but everything works with iOS 7.1

前端 未结 2 1332
梦如初夏
梦如初夏 2021-02-04 18:06

I\'m working with QuickLook to view PDF Files.

It\'s working properly in iOS 7.1 but some problems happens with iOS 8 GM.

Pictures are better than words, I wanna

2条回答
  •  佛祖请我去吃肉
    2021-02-04 18:33

    I've been recently able to fix the background issue bug (the animation is still choppy).

    To fix the 'black background' issue I set a custom background color of navigation controller's view on push. When returning back to my view controller I make sure to restore the original background color to nil.

    - (void)viewWillApear:(BOOL)animated {
       [super viewWillApear:animated];
       self.navigationController.view.backgroundColor = nil;
    
       // Optional - In order to ease the animation bug
       self.view.alpha = 1.0;
    }
    
    
    - (void)viewWillDissapear:(BOOL)animated {
       [super viewWillDissapear:animated];
       self.navigationController.view.backgroundColor = [UIColor whiteColor];
    
       // Optional - In order to ease the animation bug
       [UIView animateWithDuration:0.35 animations:^{
          self.view.alpha = 0.0;
       }];
    }
    

    This code should go to your view controller from which you're pushing QLPreviewController.

    This solution is definitely a hack at it's best, but hope it helps!

提交回复
热议问题