HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Quicklook / QLPreviewController,iOS 8的一些问题,但一切都适用于iOS 7.1大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用QuickLook查看PDF文件.

它在iOS 7.1中正常工作,但iOS 8 GM会出现一些问题.

图片文字好,我想告诉你问题:

iOS 7.1 Xcode 6(工作正常)

使用QuickLook进行转换(没有失败)

页面滚动,navigationBar隐藏得很好

————————————————– ————————

而现在,iOS 8 GM与Xcode 6

使用QuickLook进行转换…

页面滚动,navigationBar不隐藏,页面指示器隐藏在NavigationBar后面

与iPhone模拟器,iPad模拟器,iPhone设备和iPad设备相同的问题.

你可以在这里看到我的源代码

- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)previewController
{
    NSInteger numToPreview = 0;
    if (currentSection == CVSectionConvocations)
        numToPreview = self.convocation.convocations.count;
    else if (currentSection == CVSectionAttachments)
        numToPreview = self.convocation.attachements.count;
    return numToPreview;
}

- (id)previewController:(QLPreviewController *)previewController previewItemATindex:(NSInteger)idx
{
    PDF *pdf;
    if (currentSection == CVSectionConvocations)
        pdf = self.convocation.convocations[idx];
    else if (currentSection == CVSectionAttachments)
        pdf = self.convocation.attachements[idx];
    return [pdf path];
}



- (void)collectionView:(UICollectionView *)collectionView didSELEctItemATindexPath:(NSIndexPath *)indexPath {
    // determine section
    currentSection = (indexPath.section == 0 ? CVSectionConvocations : CVSectionAttachments);

    PDF *pdf;
    if (currentSection == CVSectionConvocations)
        pdf = self.convocation.convocations[indexPath.row];
    else if (currentSection == CVSectionAttachments)
        pdf = self.convocation.attachements[indexPath.row];

    if ([pdf isStored]) {
        QLPreviewController *previewController = [[QLPreviewController alloc] init];
        previewController.datasource = self;
        previewController.delegate = self;

        previewController.currentPreviewItemIndex = indexPath.row;
        [[self navigationController] pushViewController:previewController animated:YES];
    } else {
        [self displaymessage:@"Document not found" title:@"Oups !"];
    }
}

谢谢你的帮助

本图文内容来源于网友网络收集整理提供,作为学习参使用,版权属于原作者。

大佬总结

以上是大佬教程为你收集整理的Quicklook / QLPreviewController,iOS 8的一些问题,但一切都适用于iOS 7.1全部内容,希望文章能够帮你解决Quicklook / QLPreviewController,iOS 8的一些问题,但一切都适用于iOS 7.1所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。