如何隐藏底部工具栏

时间:2018-07-18 08:54:04

标签: ios objective-c navigation uibarbuttonitem photo-gallery

我在向相册显示一个带有以下按钮的工具栏时遇到问题,上一个按钮和一个新按钮出现在底部视图中。如何隐藏此工具栏?

谢谢。

Album photo image

 UIImagePickerController *controller = [[UIImagePickerController alloc] init];
            controller.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
            controller.allowsEditing = YES;
            controller.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType: UIImagePickerControllerSourceTypePhotoLibrary];
            controller.delegate = self;
            [self.navigationController presentViewController: controller animated: YES completion: nil];

3 个答案:

答案 0 :(得分:2)

如果要隐藏工具栏,可以使用以下代码。在这里,toolBarName是工具栏的名称。

toolBarName.hidden=YES;

答案 1 :(得分:0)

将其包含在viewWillAppear函数中

self.navigationController?.isToolbarHidden = true

但是,这是一个Swift解决方案。

答案 2 :(得分:0)

使用此代码。希望对您有所帮助。

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init] ;
    if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
{

imagePickerController.delegate = self;

imagePickerController.allowsEditing = FALSE;

[imagePickerController setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];

[self presentViewController:imagePickerController animated:YES completion:nil];

 }