dispatch_async(dispatch_get_main_queue(), ^{
QLPreviewController* cntr = [[QLPreviewController alloc] init];
cntr.delegate = weakSelf;
cntr.dataSource = weakSelf;
if (callback) {
callback(@[[NSNull null], array]);
}
UIViewController* root = [[[UIApplication sharedApplication] keyWindow] rootViewController];
[root presentViewController:cntr animated:YES completion:nil];
});
答案 0 :(得分:0)
我能够完成这项工作的唯一方法是使用self.navigationController.push
代替self.present
来显示您需要的QLPreviewController
子类QLPreviewController
并进行一些修改
#import "CustomPreviewViewController.h"
@implementation CustomPreviewViewController
-(void)viewDidLoad
{
[super viewDidLoad];
[self.navigationItem setHidesBackButton:YES];
[self.navigationItem setLeftItemsSupplementBackButton:YES];
[self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc]initWithTitle:@"none" style:UIBarButtonItemStyleDone target:nil action:nil]];
}
@end
希望这有帮助