Remove right navigation item, while previewing the document

♀尐吖头ヾ 提交于 2019-12-11 20:14:33

问题


I am doing following code in didSelectRowAtIndexPath, document is opening but right navigation item is not removed.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (url) {
        self.pdf_viewer = [UIDocumentInteractionController interactionControllerWithURL:url];
        [self.pdf_viewer setDelegate:self];
        [self.pdf_viewer presentPreviewAnimated:YES];
     }
}

and

- (UIViewController *)documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller {
    self.navigationItem.rightBarButtonItem = nil;
    return self;
}

回答1:


On document is opening , do rightBarButtonItem = nil

if (url) {
    self.pdf_viewer = [UIDocumentInteractionController interactionControllerWithURL:url];
    [self.pdf_viewer setDelegate:self];
    [self.pdf_viewer presentPreviewAnimated:YES];
   self.navigationItem.rightBarButtonItem = nil;
}

and after closing document set again button..



来源:https://stackoverflow.com/questions/25079923/remove-right-navigation-item-while-previewing-the-document

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!