开发者

Show a modalViewController after image picking

开发者 https://www.devze.com 2023-01-19 04:09 出处:网络
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 IB

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

精彩评论

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