开发者

Show a modalViewController after image picking

I want to present a modalViewController(do some picture drawing) right after dismiss the imagePickerController(exactly after finish image picking). I've tried to set up 开发者_StackOverflow中文版a IBAction with a bar button and it works fine when I tap it. But what I want is present the modalViewController as soon as I finish the image picking Here is my code:

-(void)imagePickerController:(UIImagePicerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info{

    [self dismissModalViewControllerAnimated:YES]; 
    //dismiss the imagePickerController
    drawViewController *drawView = [[drawViewController alloc] init];
    [self presentModalViewController:drawView animated:YES];
  }

Thanks!


The dismiss and presentModal can't both animate in the same method. The presentModal will seem to do nothing. For the dismiss, try setting the animated to NO.


After dissmissing the imagePickerController the viewDidAppear is called. You can there call the drawViewcontroller.

    -(void)viewDidAppear:(BOOL)animated{
       drawViewController *drawView = [[drawViewController alloc] init];
       [self presentModalViewController:drawView animated:YES];

    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜