UIImagePickerController how to hide the flip camera button?

Is there a way to hide the flip camera button inside the UIImagePickerController?

Thanks for reading ! ^ _ ^!

+4
source share
2 answers

As a result, I used my own subclass of UIImagePickerController to fix this (and other) problems:

#import "SMImagePickerController.h" @implementation SMImagePickerController void hideFlipButtonInSubviews(UIView *view) { if ([[[view class] description] isEqualToString:@"CAMFlipButton"]) { [view setHidden:YES]; } else { for (UIView *subview in [view subviews]) { hideFlipButtonInSubviews(subview); } } } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; hideFlipButtonInSubviews(self.view); } @end 
+6
source

You should be able to create an empty button inside an overlay that you float on top of the flip camera button. I cracked the code below to check and it seemed to work. Give it a try.

 UIView *cameraOverlayView = [[UIView alloc] initWithFrame:CGRectMake(screenSize.width - 100.0f, 5.0f, 100.0f, 35.0f)]; [cameraOverlayView setBackgroundColor:[UIColor blackColor]]; UIButton *emptyBlackButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 35.0f)]; [emptyBlackButton setBackgroundColor:[UIColor blackColor]]; [emptyBlackButton setEnabled:YES]; [cameraOverlayView addSubview:emptyBlackButton]; cameraUI.allowsEditing = YES; cameraUI.showsCameraControls = YES; cameraUI.delegate = self; cameraUI.cameraOverlayView = cameraOverlayView; 
+3
source

Source: https://habr.com/ru/post/1399281/


All Articles