1

私は持っUIViewControllerていUIToolBarます。
しかもUIToolBarボタンは3つ[options,pickphotofromlibrary,camera].

ユーザーがカメラ ボタンを押すと、カスタム カメラ インターフェイス [オーバーレイ] に移動します。

コード:

- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType

{
if (self.imageView.isAnimating)
{
    [self.imageView stopAnimating];
}

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = sourceType;
imagePickerController.delegate = self;

if (sourceType == UIImagePickerControllerSourceTypeCamera)
{
    /*
     The user wants to use the camera interface. Set up our custom overlay view for the camera.
     */
    imagePickerController.showsCameraControls = NO;

    /*
     Load the overlay view from the OverlayView nib file. Self is the File's Owner for the nib file, so the overlayView outlet is set to the main view in the nib. Pass that view to the image picker controller to use as its overlay view, and set self's reference to the view to nil.
     */
    [[NSBundle mainBundle] loadNibNamed:@"overlayView" owner:self options:nil];
    self.overlayView.frame = imagePickerController.cameraOverlayView.frame;
    imagePickerController.cameraOverlayView = self.overlayView;
    self.overlayView = nil;
}


[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];



self.imagePickerController = imagePickerController;

[self.navigationController presentViewController:self.imagePickerController animated:YES completion:nil];

}

そのため、ユーザーが写真を撮ったら、テーブル ビューを表示する別のビューをプッシュする必要があります。nib ファイルを作成しましたが、さらに先に進む方法がわかりません。

どんな助けでも大歓迎です..

4

2 に答える 2

1

次のデリゲートメソッドを使用する必要がありますUIImagePickerController

#pragma mark -
#pragma mark - UIImagePickerController Delegate Method

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
     // This code is for dismiss your UIImagePickerController
     [self dismissViewControllerAnimated:YES completion:nil]; 

     //And then write code of your Next ViewController

}
于 2013-10-25T12:14:41.280 に答える
0

UIImagePickerController関数を持つデリゲートを持っている

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
   // put code here to push the second view controller
}

UIImagePickerViewController リファレンス

于 2013-10-25T12:15:44.170 に答える