我显示了带有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)
}
当我运行它时,我得到了图库,但是顶部通常没有取消按钮。
答案 0 :(得分:0)
实施Bars
并创建一个变量以分配UIImagePickerController FilterValue
并设置FilterBars
。
UIImagePickerControllerDelegate , UINavigationControllerDelegate