UIImagePickerController how to hide the flip camera button?

前端 未结 2 1305
情话喂你
情话喂你 2021-01-06 09:18

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

thanks for reading !^_^!

2条回答
  •  爱一瞬间的悲伤
    2021-01-06 09:50

    You should be able to create an empty button inside an overlayview that you float on top of the flip camera button. I hacked the code below to test 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;
    

提交回复
热议问题