小编rau*_*aul的帖子

iOS 自定义 UIImagePickerController 相机裁剪为圆形 - 在预览视图中

我正在使用此代码来制作自定义相机裁剪:

UIImagePickerController 编辑视图圆圈叠加

这在相机胶卷中效果很好,但不能拍照

如果我更改 [navigationController.viewControllers count] == 3 --> [navigationController.viewControllers count] == 1 也适用于相机,但不适用于下一个视图(您接受使用照片的预览视图)

谁来帮帮我??

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
    NSLog(@"Camara");
    UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.allowsEditing = YES;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.delegate = self;
    self.isCamera = YES;

    [self presentViewController:imagePicker animated:YES completion:nil];

}else{
    NSLog(@"Carrete");
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]init];
    imagePickerController.allowsEditing = YES;
    imagePickerController.delegate = self;
    imagePickerController.sourceType =  UIImagePickerControllerSourceTypePhotoLibrary;
    self.isCamera = NO;
    [self presentViewController:imagePickerController animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)

}

- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
if …
Run Code Online (Sandbox Code Playgroud)

camera uiimagepickercontroller ios

3
推荐指数
1
解决办法
5849
查看次数

标签 统计

camera ×1

ios ×1

uiimagepickercontroller ×1