UIImagePickerController后退按钮/取消按钮不可见

时间:2019-01-29 21:04:11

标签: ios swift uiviewcontroller uikit uiimagepickercontroller

我显示了带有UIImagePickerController的手机图库,但是上面没有后退/取消按钮。如何添加一个?

我所拥有的(在UIViewController内部):

func openGallery() {
  let picker = UIImagePickerController()
  picker.allowsEditing = false
  picker.sourceType = .photoLibrary
  picker.mediaTypes =
    UIImagePickerController.availableMediaTypes(for: .photoLibrary)!
  present(picker, animated: true, completion: nil)
}

当我运行它时,我得到了图库,但是顶部通常没有取消按钮。

1 个答案:

答案 0 :(得分:0)

实施Bars并创建一个变量以分配UIImagePickerController FilterValue 并设置FilterBars

UIImagePickerControllerDelegate , UINavigationControllerDelegate