I am doing one application. In that I am using the camera to take the pictures from rear camera only. So I want to disable the camera switch button(rear to front and front to rear). So please guide me how to do this?
Asked
Active
Viewed 1,780 times
0
-
4Possible duplicate of [UIImagePickerController how to hide the flip camera button?](http://stackoverflow.com/questions/9525736/uiimagepickercontroller-how-to-hide-the-flip-camera-button) – Rajan Balana Nov 10 '16 at 05:13
1 Answers
1
In objective-c
picker.cameraDevice=UIImagePickerControllerCameraDeviceRear;
In swift (I used 2.3)
picker.cameraDevice=UIImagePickerControllerCameraDevice.Rear
imagePicker.cameraOverlayView = UIView(frame: CGRectMake(0,0,screenSize.width,40))
imagePicker.cameraOverlayView?.backgroundColor = UIColor.blackColor()

Hrishikesh Menon
- 139
- 12
-
If i turn to landscape mode,on that time again flip button is appearing,And my app supports portrait only – Venkata Naresh Nov 10 '16 at 08:53
-
This link might help with camera orientations http://stackoverflow.com/a/14812010/5409618 If you can know that the orientation is landscape, you can change the code as: imagePicker.cameraOverlayView = UIView(frame: CGRectMake(screenSize.width - 40,0,40,screenSize.height)) – Hrishikesh Menon Nov 11 '16 at 07:30