1

在我的项目中,我使用GDFileManagerKit从 DropBox 和 Google Drive 中选择文件。我像这样打开文件管理器;

UIStoryboard *fileBrowserStoryboard = [UIStoryboard storyboardWithName:@"FileBrowser"
                                                                bundle:[NSBundle   bundleWithURL:[[NSBundle mainBundle] URLForResource:@"GDFileManagerKit"
                                                                                                                       withExtension:@"bundle"]]
                                       ];
GDFileServiceSessionListController *serviceController = [fileBrowserStoryboard instantiateInitialViewController];
[self.navigationController pushViewController:serviceController animated:YES];

这里的问题是,当视图被推入堆栈时,屏幕左上角没有“返回”按钮。

GDFileManagerKit (GDFileServiceSessionListController.m: viewDidLoad) 中的代码是:

if ([self presentingViewController]) {
    // If we are being presented, then we should have a cancel button.
    UIBarButtonItem *cancelItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel:)];
    self.navigationItem.leftBarButtonItem = cancelItem;
}

当我评论这条if语句时,我确实看到了一个后退按钮。有没有办法防止显示取消按钮,或者在控制器呈现它的视图时将其删除而不破解 GDFileManagerKit?

4

0 回答 0