因客户特殊要求,想要实现在ipad上浏览pdf文件,实现左右滑动模式,我本身用mui+h5开发的,目前能满足客户要求的只有原生的,目前找到一款QLPreviewController符合客户要求,请哪位大神能帮忙转换成NJS代码,谢谢啦
下面这是我网上找的QLPreviewController原生代码:
//创建一个QLPreviewController实例,设置数据源和代理
- (void)clickBtn:(UIButton *)btn {
QLPreviewController *previewController = [[QLPreviewController alloc] init];
previewController.dataSource = self;
previewController.delegate = self;
[self presentViewController:previewController animated:YES completion:nil];
}
//实现协议方法
#pragma mark - QLPreviewControllerDataSource
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller {
return 1;
}
- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"iOS并发编程指南.pdf" ofType:nil];
return [NSURL fileURLWithPath:filePath];
}
- (void)previewControllerWillDismiss:(QLPreviewController *)controller {
NSLog(@"视图即将dismiss");
}
5 个回复
wenq811 (作者)
要沉了吗
wenq811 (作者)
没有大神帮忙解决一下么
wenq811 (作者)
求各路大神帮忙解决一下
wenq811 (作者)
@DCloud_IOS_XTY
wenq811 (作者)
@DCloud_App_Array 麻烦大神帮忙解决一下,谢谢!