Search code examples
iosuiimagepickercontroller

How to remove the range slider of UIImagePickerController?


There is a slider bar in my customized UIImagePickerController.
I've already removed the default camera controls and set a customized overlay view.

    self.showsCameraControls = false;
    self.cameraOverlayView = self.overlayView;

But there is a range bar still on the view. I can't find any related property or method to remove it. enter image description here enter image description here

Any advice will be appreciate.


Solution

  • Got the solution.
    Answered Here as well.

    showsCameraControls should be set before the UIImageViewController is loaded.
    That means you could do it in the initialization of your customized UIImageViewController.

    - (instancetype)init {
        if (self = [super init]) {
            self.showsCameraControls = false;
    
            self.sourceType = UIImagePickerControllerSourceTypeCamera;
            self.delegate = self;
        }
        return self;
    }