1

全て

デリゲートを使用して UIImagePickerController を作成し、PhotoLibrary から画像を選択しました。

imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType =  UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
[self presentModalViewController:imagePicker animated:YES];

そして、アプリケーションが UIImagePickerController の編集ビューに到達したら、1 つのオーバーレイ ビューを設定し、2 つのボタンを作成します。 Cancel and Choose

キャンセルボタンクリック時

[imagePicker popToViewController:[currentViewController.viewControllers objectAtIndex:1] animated:YES];

このタラはうまくいきます..

しかし、chooseボタンが機能しません。ここのようなコードを設定すると、

[self imagePickerController:imagePicker didFinishPickingMediaWithInfo:[imagePicker mediaTypes]];

情報辞書の NULL 値を返すよりも。

Editing ImagePicker でオーバーレイビューを設定する他の方法はありますか?

よろしく、

4

1 に答える 1

0

このコードを試してください

CustomOverlayView *CustomOverlayView = [[CustomOverlayView alloc] initWithFrame:CGRectZero];

    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        imagePickerController = [[UIImagePickerController alloc] init];
        imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;     
        imagePickerController.allowsEditing = NO;
        imagePickerController.delegate = self;
        imagePickerController.showsCameraControls = YES;
        [imagePickerController.view addSubview:CustomOverlayView];
        [self presentModalViewController:imagePickerController animated:YES];

    }
于 2012-06-16T12:13:41.180 に答える