如何在基于分割视图的 iPad 应用程序中显示文档的快速查看
我必须在基于 splitview 的应用程序的详细视图中显示文档的快速查看。在主视图中,我有一个 UITableView,其中包含我的应用程序的 Document 文件夹中的所有文件的列表。
我尝试在 DetailViewController 中使用 QLPreviewController,以这种方式:
QLPreviewController *previewController = [[QLPreviewController alloc] init];
previewController.dataSource = self;
previewController.delegate = self;
previewController.currentPreviewItemIndex = ...;
[[self navigationController] pushViewController:previewController animated:YES];
[previewController release];
我能够看到预览文档的,但我不再看到详细视图顶部的工具栏,并且在纵向模式下我永远卡住了,因为我无法在主视图中看到文件列表。
我还尝试使 DetailViewController 成为 QLPreviewController 的子类,但没有成功。
I have to show quick look of a document in the detailView of a splitview based app. In the master view I have a UITableView with the list of all the files in the Document folder of my app.
I'm trying to use the QLPreviewController in the DetailViewController, in this way:
QLPreviewController *previewController = [[QLPreviewController alloc] init];
previewController.dataSource = self;
previewController.delegate = self;
previewController.currentPreviewItemIndex = ...;
[[self navigationController] pushViewController:previewController animated:YES];
[previewController release];
I'm able to see the preview of the document, but I don't longer see the toolbar at the top of the detail view, and in portrait mode I'm stuck forever, because I'm not able to see the file list in the master view.
I also tried to make DetailViewController subclass of QLPreviewController, but without success.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为,根据您的描述,我认为您不需要将previewController推入[self navigationController],而是将previewController设置为UISplitViewController的详细视图。
可以像这样完成
如果您想让预览控制器出现导航栏,您可以用 UINavigationController 包装预览控制器,然后将其设置为 UISplitViewController 中的详细视图,如下所示
:
I think instead of pushing the previewController into the [self navigationController], what I believe you need to do instead, from what you described, is to set the previewController as the detail view of your UISplitViewController.
This can be done like so
If you want to have the navigation bar for for the previewController to appear, you can wrap the previewController with a UINavigationController before setting it as the detail view in UISplitViewController like so:
Cheers
尝试
代替
Try
instead of