在我的项目中,我使用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的情况下呈现它的视图时将其删除?