如何隐藏底部工具栏



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

提前谢谢。

相簿照片图像

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];

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

toolBarName.hidden=YES;

将其包含在viewWillAppear函数中:

self.navigationController?.isToolbarHidden = true

然而,这是一个Swift解决方案。

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

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];
}

相关内容

  • 没有找到相关文章

最新更新