Swift:如何使用带有按钮

时间:2016-01-14 10:20:41

标签: ios swift uiimagepickercontroller nib

在我的应用中,我正在开发一个自定义UIPickerView来拍照。在this教程之后,我创建了一个与其.xib子类关联的UIView文件。我在以下屏幕截图中得到了结果:

enter image description here

正如你所看到的,"空间"插入按钮和其他东西完全在底部,而我想将它分成两个条,如默认模式:

enter image description here

这样我就可以添加"取消"按钮广告左上角。 我该怎么办?这是我的代码:

self.imagePicker =  UIImagePickerController()
self.imagePicker.delegate = self
self.imagePicker.sourceType = .Camera
self.imagePicker.cameraCaptureMode = .Photo
self.imagePicker.showsCameraControls = false
self.imagePicker.modalPresentationStyle = .FullScreen

//customView stuff
let customViewController = CustomOverlayViewController(
    nibName:"CustomOverlayViewController",
    bundle: nil
)
let customView:CustomOverlayView = customViewController.view as! CustomOverlayView
customView.frame = self.imagePicker.view.frame

presentViewController(imagePicker, animated: true, completion: {
    self.imagePicker.cameraOverlayView = customView
})

0 个答案:

没有答案